mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-10-15 18:55:02 +08:00
* tif图片预览,在application.properties中加入tif.preview.type = ${KK_TIF_PREVIEW_TYPE:tif},可以控制使用tif、jpg、pdf方式预览。
修改相应代码,加入必要的判断处理。
This commit is contained in:
@@ -37,6 +37,7 @@ public class ConfigConstants {
|
||||
private static CopyOnWriteArraySet<String> trustHostSet;
|
||||
private static String pdfDownloadDisable;
|
||||
private static Boolean fileUploadDisable;
|
||||
private static String tifPreviewType;
|
||||
|
||||
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";
|
||||
@@ -52,7 +53,7 @@ public class ConfigConstants {
|
||||
public static final String DEFAULT_TRUST_HOST = "default";
|
||||
public static final String DEFAULT_PDF_DOWNLOAD_DISABLE = "true";
|
||||
public static final String DEFAULT_FILE_UPLOAD_DISABLE = "false";
|
||||
|
||||
public static final String DEFAULT_TIF_PREVIEW_TYPE = "jpg";
|
||||
|
||||
public static Boolean isCacheEnabled() {
|
||||
return cacheEnabled;
|
||||
@@ -284,4 +285,18 @@ public class ConfigConstants {
|
||||
public static void setFileUploadDisableValue(Boolean fileUploadDisable) {
|
||||
ConfigConstants.fileUploadDisable = fileUploadDisable;
|
||||
}
|
||||
|
||||
|
||||
public static String getTifPreviewType() {
|
||||
return tifPreviewType;
|
||||
}
|
||||
|
||||
@Value("${tif.preview.type:tif}")
|
||||
public void setTifPreviewType(String tifPreviewType) {
|
||||
setTifPreviewTypeValue(tifPreviewType);
|
||||
}
|
||||
|
||||
public static void setTifPreviewTypeValue(String tifPreviewType) {
|
||||
ConfigConstants.tifPreviewType = tifPreviewType;
|
||||
}
|
||||
}
|
||||
|
@@ -49,6 +49,8 @@ public class ConfigRefreshComponent {
|
||||
String trustHost;
|
||||
String pdfDownloadDisable;
|
||||
boolean fileUploadDisable;
|
||||
String tifPreviewType;
|
||||
|
||||
while (true) {
|
||||
FileReader fileReader = new FileReader(configFilePath);
|
||||
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||
@@ -68,6 +70,8 @@ public class ConfigRefreshComponent {
|
||||
trustHost = properties.getProperty("trust.host", ConfigConstants.DEFAULT_TRUST_HOST);
|
||||
pdfDownloadDisable = properties.getProperty("pdf.download.disable", ConfigConstants.DEFAULT_PDF_DOWNLOAD_DISABLE);
|
||||
fileUploadDisable = Boolean.parseBoolean(properties.getProperty("file.upload.disable", ConfigConstants.DEFAULT_FILE_UPLOAD_DISABLE));
|
||||
tifPreviewType = properties.getProperty("tif.preview.type", ConfigConstants.DEFAULT_TIF_PREVIEW_TYPE);
|
||||
|
||||
ConfigConstants.setCacheEnabledValueValue(cacheEnabled);
|
||||
ConfigConstants.setSimTextValue(textArray);
|
||||
ConfigConstants.setMediaValue(mediaArray);
|
||||
@@ -80,6 +84,7 @@ public class ConfigRefreshComponent {
|
||||
ConfigConstants.setOfficePreviewSwitchDisabledValue(officePreviewSwitchDisabled);
|
||||
ConfigConstants.setPdfDownloadDisableValue(pdfDownloadDisable);
|
||||
ConfigConstants.setFileUploadDisableValue(fileUploadDisable);
|
||||
ConfigConstants.setTifPreviewTypeValue(tifPreviewType);
|
||||
setWatermarkConfig(properties);
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
|
Reference in New Issue
Block a user