mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-04-11 18:47:23 +00:00
新增PDF线程管理,超时管理,内存缓存管理,更新PDF解析组件版本
This commit is contained in:
@@ -67,6 +67,10 @@ public class ConfigConstants {
|
||||
private static String homePagination;
|
||||
private static String homePageSize;
|
||||
private static String homeSearch;
|
||||
private static int pdfTimeout;
|
||||
private static int pdfTimeout80;
|
||||
private static int pdfTimeout200;
|
||||
private static int pdfThread;
|
||||
|
||||
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,xbrl";
|
||||
@@ -107,6 +111,10 @@ public class ConfigConstants {
|
||||
public static final String DEFAULT_HOME_PAGINATION = "true";
|
||||
public static final String DEFAULT_HOME_PAGSIZE = "15";
|
||||
public static final String DEFAULT_HOME_SEARCH = "true";
|
||||
public static final String DEFAULT_PDF_TIMEOUT = "90";
|
||||
public static final String DEFAULT_PDF_TIMEOUT80 = "180";
|
||||
public static final String DEFAULT_PDF_TIMEOUT200 = "300";
|
||||
public static final String DEFAULT_PDF_THREAD = "5";
|
||||
|
||||
public static Boolean isCacheEnabled() {
|
||||
return cacheEnabled;
|
||||
@@ -580,6 +588,65 @@ public class ConfigConstants {
|
||||
ConfigConstants.cadThread = cadThread;
|
||||
}
|
||||
|
||||
/**
|
||||
* 以下为pdf转换模块设置
|
||||
*/
|
||||
public static int getPdfTimeout() {
|
||||
return pdfTimeout;
|
||||
}
|
||||
|
||||
@Value("${pdf.timeout:90}")
|
||||
public void setPdfTimeout(int pdfTimeout) {
|
||||
setPdfTimeoutValue(pdfTimeout);
|
||||
}
|
||||
|
||||
public static void setPdfTimeoutValue(int pdfTimeout) {
|
||||
ConfigConstants.pdfTimeout = pdfTimeout;
|
||||
}
|
||||
|
||||
|
||||
public static int getPdfTimeout80() {
|
||||
return pdfTimeout80;
|
||||
}
|
||||
|
||||
@Value("${pdf.timeout80:180}")
|
||||
public void setPdfTimeout80(int pdfTimeout80) {
|
||||
setPdfTimeout80Value(pdfTimeout80);
|
||||
}
|
||||
|
||||
public static void setPdfTimeout80Value(int pdfTimeout80) {
|
||||
ConfigConstants.pdfTimeout80 = pdfTimeout80;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static int getPdfTimeout200() {
|
||||
return pdfTimeout200;
|
||||
}
|
||||
|
||||
@Value("${pdf.timeout200:300}")
|
||||
public void setPdfTimeout200(int pdfTimeout200) {
|
||||
setPdfTimeout200Value(pdfTimeout200);
|
||||
}
|
||||
|
||||
public static void setPdfTimeout200Value(int pdfTimeout200) {
|
||||
ConfigConstants.pdfTimeout200 = pdfTimeout200;
|
||||
}
|
||||
|
||||
|
||||
public static int getPdfThread() {
|
||||
return pdfThread;
|
||||
}
|
||||
|
||||
@Value("${pdf.thread:5}")
|
||||
public void setPdfThread(int pdfThread) {
|
||||
setPdfThreadValue(pdfThread);
|
||||
}
|
||||
|
||||
public static void setPdfThreadValue(int pdfThread) {
|
||||
ConfigConstants.pdfThread = pdfThread;
|
||||
}
|
||||
|
||||
/**
|
||||
* 以下为OFFICE转换模块设置
|
||||
*/
|
||||
|
||||
@@ -78,6 +78,10 @@ public class ConfigRefreshComponent {
|
||||
String homePagination;
|
||||
String homePageSize;
|
||||
String homeSearch;
|
||||
int pdfTimeout;
|
||||
int pdfTimeout80;
|
||||
int pdfTimeout200;
|
||||
int pdfThread;
|
||||
while (true) {
|
||||
FileReader fileReader = new FileReader(configFilePath);
|
||||
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||
@@ -126,6 +130,10 @@ public class ConfigRefreshComponent {
|
||||
homePageSize = properties.getProperty("home.pagesize", ConfigConstants.DEFAULT_HOME_PAGSIZE);
|
||||
homeSearch = properties.getProperty("home.search", ConfigConstants.DEFAULT_HOME_SEARCH);
|
||||
cadThread = Integer.parseInt(properties.getProperty("cad.thread", ConfigConstants.DEFAULT_CAD_THREAD));
|
||||
pdfTimeout = Integer.parseInt(properties.getProperty("pdf.timeout", ConfigConstants.DEFAULT_PDF_TIMEOUT));
|
||||
pdfTimeout80 = Integer.parseInt(properties.getProperty("pdf.timeout80", ConfigConstants.DEFAULT_PDF_TIMEOUT80));
|
||||
pdfTimeout200 = Integer.parseInt(properties.getProperty("pdf.timeout200", ConfigConstants.DEFAULT_PDF_TIMEOUT200));
|
||||
pdfThread = Integer.parseInt(properties.getProperty("pdf.thread", ConfigConstants.DEFAULT_PDF_THREAD));
|
||||
prohibitArray = prohibit.split(",");
|
||||
|
||||
ConfigConstants.setCacheEnabledValueValue(cacheEnabled);
|
||||
@@ -169,6 +177,10 @@ public class ConfigRefreshComponent {
|
||||
ConfigConstants.setHomePaginationValue(homePagination);
|
||||
ConfigConstants.setHomePageSizeValue(homePageSize);
|
||||
ConfigConstants.setHomeSearchValue(homeSearch);
|
||||
ConfigConstants.setPdfTimeoutValue(pdfTimeout);
|
||||
ConfigConstants.setPdfTimeout80Value(pdfTimeout80);
|
||||
ConfigConstants.setPdfTimeout200Value(pdfTimeout200);
|
||||
ConfigConstants.setPdfThreadValue(pdfThread);
|
||||
setWatermarkConfig(properties);
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
|
||||
Reference in New Issue
Block a user