word、ppt文档新增图片预览模式

This commit is contained in:
陈精华
2019-04-25 18:39:58 +08:00
committed by kl
parent 68aa5db66b
commit b4d3419797
20 changed files with 312 additions and 5 deletions

View File

@ -17,6 +17,7 @@ public class ConfigConstants {
private static String[] simText = {};
private static String[] media = {};
private static String convertedFileCharset;
private static String officePreviewType;
private static String fileDir = OfficeUtils.getHomePath() + File.separator + "file" + File.separator;
public static String[] getSimText() {
@ -43,6 +44,14 @@ public class ConfigConstants {
ConfigConstants.convertedFileCharset = convertedFileCharset;
}
public static String getOfficePreviewType() {
return officePreviewType;
}
public static void setOfficePreviewType(String officePreviewType) {
ConfigConstants.officePreviewType = officePreviewType;
}
public static String getFileDir() {
return fileDir;
}

View File

@ -1,5 +1,6 @@
package cn.keking.config;
import cn.keking.service.impl.OfficeFilePreviewImpl;
import org.artofsolving.jodconverter.office.OfficeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -40,8 +41,9 @@ public class ConfigRefreshComponent {
String text;
String media;
String convertedFileCharset = sysProperties.getProperty("sun.jnu.encoding");
String[] textArray ;
String[] textArray;
String[] mediaArray;
String officePreviewType;
String configFilePath = OfficeUtils.getCustomizedConfigPath();
while (true) {
BufferedReader bufferedReader = new BufferedReader(new FileReader(configFilePath));
@ -49,11 +51,13 @@ public class ConfigRefreshComponent {
text = properties.getProperty("simText", DEFAULT_TXT_TYPE);
media = properties.getProperty("media", DEFAULT_MEDIA_TYPE);
convertedFileCharset = properties.getProperty("converted.file.charset", convertedFileCharset);
officePreviewType = properties.getProperty("office.preview.type", OfficeFilePreviewImpl.OFFICE_PREVIEW_TYPE_IMAGE);
textArray = text.split(",");
mediaArray = media.split(",");
ConfigConstants.setSimText(textArray);
ConfigConstants.setMedia(mediaArray);
ConfigConstants.setConvertedFileCharset(convertedFileCharset);
ConfigConstants.setOfficePreviewType(officePreviewType);
Thread.sleep(1000L);
}
} catch (IOException | InterruptedException e) {