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