正则 定义为常量
This commit is contained in:
		| @@ -15,6 +15,7 @@ public class Const { | ||||
|     public static String LOGIN_SESSION_KEY = "Favorites_user"; | ||||
|  | ||||
|     public static String PASSWORD_KEY = "@#$%^&*()OPG#$%^&*(HG"; | ||||
|     public static String URL_CODE = "(?<=charset=)(.+)(?=\")";//取网址的编码 | ||||
|  | ||||
|     public static String DES3_KEY = "9964DYByKL967c3308imytCB"; | ||||
|  | ||||
| @@ -29,6 +30,8 @@ public class Const { | ||||
|     public static int COOKIE_TIMEOUT= 30*24*60*60; | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| //	  @Autowired(required = true) | ||||
| //	  public void setBasePath(@Value("${favorites.base.path}")String basePath) { | ||||
| //		  Const.BASE_PATH = basePath; | ||||
|   | ||||
| @@ -283,7 +283,7 @@ public class ImportHtml { | ||||
| //	} | ||||
| // | ||||
|     public static String matchCharset(String content) { | ||||
|         Pattern p = Pattern.compile("(?<=charset=)(.+)(?=\")"); | ||||
|         Pattern p = Pattern.compile(Const.URL_CODE); | ||||
|         Matcher m = p.matcher(content); | ||||
|         if (m.find()){ | ||||
|             return m.group(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user