
com.arsframework.util.Webs Maven / Gradle / Ivy
The newest version!
package com.arsframework.util;
import java.io.*;
import java.util.Map;
import java.util.List;
import java.util.LinkedList;
import java.util.Enumeration;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.regex.Pattern;
import java.net.URLDecoder;
import java.net.URLEncoder;
import javax.servlet.http.Cookie;
import javax.servlet.ServletException;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.parser.ParserDelegator;
import com.arsframework.annotation.Min;
import com.arsframework.annotation.Nonnull;
/**
* Web处理工具类
*
* @author yongqiang.wu
*/
public abstract class Webs {
/**
* 协议枚举
*/
public enum Protocol {
/**
* HTTP协议
*/
HTTP,
/**
* HTTPS协议
*/
HTTPS;
/**
* 根据协议名称转换协议枚举
*
* @param name 协议名称
* @return 协议枚举
*/
public static Protocol parse(String name) {
return name == null ? null : Protocol.valueOf(name.toUpperCase());
}
}
/**
* 应用根路径
*/
public static final String ROOT_PATH = new File(Strings.CURRENT_PATH).getParentFile().getParentFile().getPath();
/**
* Html标本标签正则表达匹配对象
*/
public static final Pattern SCRIPT_PATTERN = Pattern.compile("