@ -50,6 +50,7 @@ public class ConfigConstants {
|
||||
private static String officeTypeWeb;
|
||||
private static String cadPreviewType;
|
||||
private static Boolean deleteSourceFile;
|
||||
private static Boolean deleteCaptcha;
|
||||
|
||||
public static final String DEFAULT_CACHE_ENABLED = "true";
|
||||
public static final String DEFAULT_TXT_TYPE = "txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd";
|
||||
@ -78,6 +79,7 @@ public class ConfigConstants {
|
||||
public static final String DEFAULT_PDF2_JPG_DPI = "105";
|
||||
public static final String DEFAULT_OFFICE_TYPE_WEB = "web";
|
||||
public static final String DEFAULT_DELETE_SOURCE_FILE = "true";
|
||||
public static final String DEFAULT_DELETE_CAPTCHA = "false";
|
||||
|
||||
public static Boolean isCacheEnabled() {
|
||||
return cacheEnabled;
|
||||
@ -447,7 +449,9 @@ public class ConfigConstants {
|
||||
setDeleteSourceFileValue(deleteSourceFile);
|
||||
}
|
||||
|
||||
|
||||
public static void setDeleteSourceFileValue(Boolean deleteSourceFile) {
|
||||
ConfigConstants.deleteSourceFile = deleteSourceFile;
|
||||
}
|
||||
|
||||
public static String getCadPreviewType() {
|
||||
return cadPreviewType;
|
||||
@ -462,8 +466,16 @@ public class ConfigConstants {
|
||||
ConfigConstants.cadPreviewType = cadPreviewType;
|
||||
}
|
||||
|
||||
public static void setDeleteSourceFileValue(Boolean deleteSourceFile) {
|
||||
ConfigConstants.deleteSourceFile = deleteSourceFile;
|
||||
public static Boolean getDeleteCaptcha() {
|
||||
return deleteCaptcha;
|
||||
}
|
||||
|
||||
@Value("${delete.captcha:false}")
|
||||
public void setDeleteCaptcha(Boolean deleteCaptcha) {
|
||||
setDeleteCaptchaValue(deleteCaptcha);
|
||||
}
|
||||
|
||||
public static void setDeleteCaptchaValue(Boolean deleteCaptcha) {
|
||||
ConfigConstants.deleteCaptcha = deleteCaptcha;
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,6 +62,7 @@ public class ConfigRefreshComponent {
|
||||
String officeTypeWeb;
|
||||
String cadPreviewType;
|
||||
boolean deleteSourceFile;
|
||||
boolean deleteCaptcha;
|
||||
while (true) {
|
||||
FileReader fileReader = new FileReader(configFilePath);
|
||||
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||
@ -94,6 +95,7 @@ public class ConfigRefreshComponent {
|
||||
pdf2JpgDpi = Integer.parseInt(properties.getProperty("pdf2jpg.dpi", ConfigConstants.DEFAULT_PDF2_JPG_DPI));
|
||||
officeTypeWeb = properties.getProperty("office.type.web", ConfigConstants.DEFAULT_OFFICE_TYPE_WEB);
|
||||
deleteSourceFile = Boolean.parseBoolean(properties.getProperty("delete.source.file", ConfigConstants.DEFAULT_DELETE_SOURCE_FILE));
|
||||
deleteCaptcha = Boolean.parseBoolean(properties.getProperty("delete.captcha", ConfigConstants.DEFAULT_DELETE_CAPTCHA));
|
||||
prohibitArray = prohibit.split(",");
|
||||
|
||||
ConfigConstants.setCacheEnabledValueValue(cacheEnabled);
|
||||
@ -121,6 +123,7 @@ public class ConfigRefreshComponent {
|
||||
ConfigConstants.setPdf2JpgDpiValue(pdf2JpgDpi);
|
||||
ConfigConstants.setOfficeTypeWebValue(officeTypeWeb);
|
||||
ConfigConstants.setDeleteSourceFileValue(deleteSourceFile);
|
||||
ConfigConstants.setDeleteCaptchaValue(deleteCaptcha);
|
||||
setWatermarkConfig(properties);
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
|
||||
Reference in New Issue
Block a user