mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-12-28 17:34:39 +08:00
新功能点:新增配置是否可以下载转换完成的pdf文件
This commit is contained in:
@@ -27,6 +27,7 @@ public class ConfigConstants {
|
||||
private static String BASE_URL;
|
||||
private static String FILE_DIR = OfficeUtils.getHomePath() + File.separator + "file" + File.separator;
|
||||
private static CopyOnWriteArraySet<String> TRUST_HOST_SET;
|
||||
private static String PDF_DOWNLOAD_DISABLE;
|
||||
|
||||
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,,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd";
|
||||
@@ -38,6 +39,7 @@ public class ConfigConstants {
|
||||
public static final String DEFAULT_BASE_URL = "default";
|
||||
public static final String DEFAULT_FILE_DIR_VALUE = "default";
|
||||
public static final String DEFAULT_TRUST_HOST = "default";
|
||||
public static final String DEFAULT_PDF_DOWNLOAD_DISABLE = "true";
|
||||
|
||||
public static Boolean isCacheEnabled() {
|
||||
return CACHE_ENABLED;
|
||||
@@ -141,4 +143,18 @@ public class ConfigConstants {
|
||||
private static void setTrustHostSet(CopyOnWriteArraySet<String> trustHostSet) {
|
||||
ConfigConstants.TRUST_HOST_SET = trustHostSet;
|
||||
}
|
||||
|
||||
|
||||
public static String getPdfDownloadDisable() {
|
||||
return PDF_DOWNLOAD_DISABLE;
|
||||
}
|
||||
|
||||
public static void setPdfDownloadDisableValue(String pdfDownloadDisable) {
|
||||
PDF_DOWNLOAD_DISABLE = pdfDownloadDisable;
|
||||
}
|
||||
|
||||
@Value("${pdf.download.disable:true}")
|
||||
public void setPdfDownloadDisable(String pdfDownloadDisable) {
|
||||
PDF_DOWNLOAD_DISABLE = pdfDownloadDisable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public class ConfigRefreshComponent {
|
||||
String configFilePath = OfficeUtils.getCustomizedConfigPath();
|
||||
String baseUrl;
|
||||
String trustHost;
|
||||
String pdfDownloadDisable;
|
||||
while (true) {
|
||||
FileReader fileReader = new FileReader(configFilePath);
|
||||
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||
@@ -60,6 +61,7 @@ public class ConfigRefreshComponent {
|
||||
mediaArray = media.split(",");
|
||||
baseUrl = properties.getProperty("base.url", ConfigConstants.DEFAULT_BASE_URL);
|
||||
trustHost = properties.getProperty("trust.host", ConfigConstants.DEFAULT_TRUST_HOST);
|
||||
pdfDownloadDisable = properties.getProperty("pdf.download.disable", ConfigConstants.DEFAULT_PDF_DOWNLOAD_DISABLE);
|
||||
ConfigConstants.setCacheEnabled(cacheEnabled);
|
||||
ConfigConstants.setSimText(textArray);
|
||||
ConfigConstants.setMedia(mediaArray);
|
||||
@@ -69,6 +71,7 @@ public class ConfigRefreshComponent {
|
||||
ConfigConstants.setFtpControlEncoding(ftpControlEncoding);
|
||||
ConfigConstants.setBaseUrl(baseUrl);
|
||||
ConfigConstants.setTrustHost(trustHost);
|
||||
ConfigConstants.setPdfDownloadDisableValue(pdfDownloadDisable);
|
||||
setWatermarkConfig(properties);
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
|
||||
Reference in New Issue
Block a user