Linux下集成OpenOffice
This commit is contained in:
@ -1,13 +1,12 @@
|
||||
package cn.keking.config;
|
||||
|
||||
import cn.keking.utils.HomePathUtils;
|
||||
import org.artofsolving.jodconverter.office.OfficeUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
@ -38,7 +37,7 @@ public class ConfigRefreshComponent {
|
||||
String convertedFileCharset;
|
||||
String[] textArray ;
|
||||
String[] mediaArray;
|
||||
String homePath = HomePathUtils.getHomePath();
|
||||
String homePath = OfficeUtils.getHomePath();
|
||||
String separator = java.io.File.separator;
|
||||
String configFilePath = homePath + separator + "conf" + separator + "application.properties";
|
||||
while (true) {
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
package cn.keking.utils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @auther: chenjh
|
||||
* @time: 2019/4/15 9:11
|
||||
* @description
|
||||
*/
|
||||
public class HomePathUtils {
|
||||
|
||||
public static String getHomePath() {
|
||||
String userDir = System.getenv("KKFILEVIEW_BIN_FOLDER");
|
||||
if (userDir == null) {
|
||||
userDir = System.getProperty("user.dir");
|
||||
}
|
||||
if (userDir.endsWith("bin")) {
|
||||
userDir = userDir.substring(0, userDir.length() - 4);
|
||||
} else {
|
||||
String separator = File.separator;
|
||||
userDir = userDir + separator + "jodconverter-web" + separator + "src" + separator + "main";
|
||||
}
|
||||
return userDir;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user