mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-10-15 18:55:02 +08:00
新增:删除转换后OFFICE、CAD、TIFF、压缩包源文件 默认开启 节约磁盘空间
This commit is contained in:
@@ -46,6 +46,7 @@ public class ConfigConstants {
|
||||
private static String[] prohibit= {};
|
||||
private static String size;
|
||||
private static String password;
|
||||
private static Boolean deletesourcefile;
|
||||
|
||||
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";
|
||||
@@ -70,6 +71,7 @@ public class ConfigConstants {
|
||||
public static final String DEFAULT_size_DISABLE = "500MB";
|
||||
public static final String DEFAULT_prohibit_DISABLE = "exe,dll";
|
||||
public static final String DEFAULT_password_DISABLE = "123456";
|
||||
public static final String DEFAULT_Delete_Source_File_PREVIEW_TYPE = "false";
|
||||
|
||||
public static Boolean isCacheEnabled() {
|
||||
return cacheEnabled;
|
||||
@@ -406,4 +408,17 @@ public class ConfigConstants {
|
||||
ConfigConstants.password = password;
|
||||
}
|
||||
|
||||
public static Boolean getdeletesourcefile() {
|
||||
return deletesourcefile;
|
||||
}
|
||||
|
||||
@Value("${delete.source.file:false}")
|
||||
public void setdeletesourcefile(Boolean deletesourcefile) {
|
||||
setdeletesourcefileValue(deletesourcefile);
|
||||
}
|
||||
|
||||
public static void setdeletesourcefileValue(Boolean deletesourcefile) {
|
||||
ConfigConstants.deletesourcefile = deletesourcefile;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -58,6 +58,7 @@ public class ConfigRefreshComponent {
|
||||
String BeiAn;
|
||||
String size;
|
||||
String password;
|
||||
Boolean deletesourcefile;
|
||||
while (true) {
|
||||
FileReader fileReader = new FileReader(configFilePath);
|
||||
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||
@@ -86,6 +87,7 @@ public class ConfigRefreshComponent {
|
||||
BeiAn = properties.getProperty("BeiAn", ConfigConstants.DEFAULT_BeiAn_DISABLE);
|
||||
prohibit = properties.getProperty("prohibit", ConfigConstants.DEFAULT_prohibit_DISABLE);
|
||||
password = properties.getProperty("sc.password", ConfigConstants.DEFAULT_password_DISABLE);
|
||||
deletesourcefile = Boolean.parseBoolean(properties.getProperty("delete.source.file", ConfigConstants.DEFAULT_Delete_Source_File_PREVIEW_TYPE));
|
||||
prohibitArray = prohibit.split(",");
|
||||
|
||||
ConfigConstants.setCacheEnabledValueValue(cacheEnabled);
|
||||
@@ -109,6 +111,7 @@ public class ConfigRefreshComponent {
|
||||
ConfigConstants.setsizeValue(size);
|
||||
ConfigConstants.setprohibitValue(prohibitArray);
|
||||
ConfigConstants.setpasswordValue(password);
|
||||
ConfigConstants.setdeletesourcefileValue(deletesourcefile);
|
||||
setWatermarkConfig(properties);
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
|
Reference in New Issue
Block a user