mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-03-14 13:13:47 +08:00
新功能点:所有配置项支持从环境变量里读取,方便Docker镜像部署
This commit is contained in:
@@ -17,7 +17,6 @@ public class ConfigConstants {
|
||||
private static Boolean cacheEnabled;
|
||||
private static String[] simText = {};
|
||||
private static String[] media = {};
|
||||
private static String convertedFileCharset;
|
||||
private static String officePreviewType;
|
||||
private static String ftpUsername;
|
||||
private static String ftpPassword;
|
||||
@@ -25,6 +24,8 @@ public class ConfigConstants {
|
||||
private static String fileDir = OfficeUtils.getHomePath() + File.separator + "file" + File.separator;
|
||||
private static String baseUrl;
|
||||
|
||||
public static final String DEFAULT_FILE_DIR_VALUE = "default";
|
||||
|
||||
public static Boolean isCacheEnabled() {
|
||||
return cacheEnabled;
|
||||
}
|
||||
@@ -49,14 +50,6 @@ public class ConfigConstants {
|
||||
ConfigConstants.media = media;
|
||||
}
|
||||
|
||||
public static String getConvertedFileCharset() {
|
||||
return convertedFileCharset;
|
||||
}
|
||||
|
||||
public static void setConvertedFileCharset(String convertedFileCharset) {
|
||||
ConfigConstants.convertedFileCharset = convertedFileCharset;
|
||||
}
|
||||
|
||||
public static String getOfficePreviewType() {
|
||||
return officePreviewType;
|
||||
}
|
||||
@@ -98,13 +91,12 @@ public class ConfigConstants {
|
||||
}
|
||||
|
||||
public static void setBaseUrl(String baseUrl) {
|
||||
// 不以'/'结尾的,加上'/'
|
||||
ConfigConstants.baseUrl = baseUrl.concat("/");
|
||||
ConfigConstants.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
@Value("${file.dir:default}")
|
||||
public void setFileDir(String fileDir) {
|
||||
if (!"default".equals(fileDir)) {
|
||||
if (!DEFAULT_FILE_DIR_VALUE.equals(fileDir.toLowerCase())) {
|
||||
if (!fileDir.endsWith(File.separator)) {
|
||||
fileDir = fileDir + File.separator;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user