2019-04-11 14:45:22 +08:00
|
|
|
package cn.keking.config;
|
|
|
|
|
2019-04-16 21:09:32 +08:00
|
|
|
import org.artofsolving.jodconverter.office.OfficeUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
2019-04-11 14:45:22 +08:00
|
|
|
/**
|
|
|
|
* @auther: chenjh
|
|
|
|
* @time: 2019/4/10 17:22
|
|
|
|
* @description
|
|
|
|
*/
|
2019-04-16 21:09:32 +08:00
|
|
|
@Component
|
2019-04-11 14:45:22 +08:00
|
|
|
public class ConfigConstants {
|
|
|
|
|
|
|
|
private static String[] simText = {};
|
|
|
|
private static String[] media = {};
|
|
|
|
private static String convertedFileCharset;
|
2019-04-16 21:09:32 +08:00
|
|
|
private static String fileDir = OfficeUtils.getHomePath() + File.separator + "file" + File.separator;
|
2019-04-11 14:45:22 +08:00
|
|
|
|
|
|
|
public static String[] getSimText() {
|
|
|
|
return simText;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setSimText(String[] simText) {
|
|
|
|
ConfigConstants.simText = simText;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String[] getMedia() {
|
|
|
|
return media;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setMedia(String[] media) {
|
|
|
|
ConfigConstants.media = media;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String getConvertedFileCharset() {
|
|
|
|
return convertedFileCharset;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setConvertedFileCharset(String convertedFileCharset) {
|
|
|
|
ConfigConstants.convertedFileCharset = convertedFileCharset;
|
|
|
|
}
|
|
|
|
|
2019-04-16 21:09:32 +08:00
|
|
|
public static String getFileDir() {
|
|
|
|
return fileDir;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Value("${file.dir:default}")
|
|
|
|
public void setFileDir(String fileDir) {
|
|
|
|
if (!"default".equals(fileDir)) {
|
|
|
|
if (!fileDir.endsWith(File.separator)) {
|
|
|
|
fileDir = fileDir + File.separator;
|
|
|
|
}
|
|
|
|
ConfigConstants.fileDir = fileDir;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-11 14:45:22 +08:00
|
|
|
}
|