mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-04-28 19:16:43 +00:00
Compare commits
1 Commits
urlencodin
...
md
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4af19dd646 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -27,6 +27,5 @@ nbdist/
|
|||||||
### VS Code ###
|
### VS Code ###
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
server/src/main/cache/
|
jodconverter-web/src/main/cache/
|
||||||
server/src/main/file/
|
jodconverter-web/src/main/file/
|
||||||
server/src/main/log
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
MAINTAINER chenjh "842761733@qq.com"
|
MAINTAINER chenjh "842761733@qq.com"
|
||||||
ADD server/target/kkFileView-*.tar.gz /opt/
|
ADD jodconverter-web/target/kkFileView-*.tar.gz /opt/
|
||||||
COPY fonts/* /usr/share/fonts/chienes/
|
COPY fonts/* /usr/share/fonts/chienes/
|
||||||
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
|
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
|
||||||
apt-get clean && apt-get update &&\
|
apt-get clean && apt-get update &&\
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>cn.keking</groupId>
|
<groupId>cn.keking</groupId>
|
||||||
<artifactId>office-plugin</artifactId>
|
<artifactId>jodconverter-core</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -19,7 +19,6 @@ import java.util.Iterator;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.artofsolving.jodconverter.util.ConfigUtils;
|
|
||||||
import org.artofsolving.jodconverter.util.PlatformUtils;
|
import org.artofsolving.jodconverter.util.PlatformUtils;
|
||||||
|
|
||||||
import com.sun.star.beans.PropertyValue;
|
import com.sun.star.beans.PropertyValue;
|
||||||
@@ -56,7 +55,7 @@ public class OfficeUtils {
|
|||||||
Map<String,Object> subProperties = (Map<String,Object>) value;
|
Map<String,Object> subProperties = (Map<String,Object>) value;
|
||||||
value = toUnoProperties(subProperties);
|
value = toUnoProperties(subProperties);
|
||||||
}
|
}
|
||||||
propertyValues[i++] = property(entry.getKey(), value);
|
propertyValues[i++] = property((String) entry.getKey(), value);
|
||||||
}
|
}
|
||||||
return propertyValues;
|
return propertyValues;
|
||||||
}
|
}
|
||||||
@@ -69,7 +68,7 @@ public class OfficeUtils {
|
|||||||
|
|
||||||
public static File getDefaultOfficeHome() {
|
public static File getDefaultOfficeHome() {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
String customizedConfigPath = ConfigUtils.getCustomizedConfigPath();
|
String customizedConfigPath = getCustomizedConfigPath();
|
||||||
try {
|
try {
|
||||||
BufferedReader bufferedReader = new BufferedReader(new FileReader(customizedConfigPath));
|
BufferedReader bufferedReader = new BufferedReader(new FileReader(customizedConfigPath));
|
||||||
properties.load(bufferedReader);
|
properties.load(bufferedReader);
|
||||||
@@ -81,7 +80,7 @@ public class OfficeUtils {
|
|||||||
}
|
}
|
||||||
if (PlatformUtils.isWindows()) {
|
if (PlatformUtils.isWindows()) {
|
||||||
// %ProgramFiles(x86)% on 64-bit machines; %ProgramFiles% on 32-bit ones
|
// %ProgramFiles(x86)% on 64-bit machines; %ProgramFiles% on 32-bit ones
|
||||||
String homePath = ConfigUtils.getHomePath();
|
String homePath = OfficeUtils.getHomePath();
|
||||||
String programFiles = System.getenv("ProgramFiles(x86)");
|
String programFiles = System.getenv("ProgramFiles(x86)");
|
||||||
if (programFiles == null) {
|
if (programFiles == null) {
|
||||||
programFiles = System.getenv("ProgramFiles");
|
programFiles = System.getenv("ProgramFiles");
|
||||||
@@ -128,7 +127,30 @@ public class OfficeUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
if (userDir.contains("jodconverter-web")) {
|
||||||
|
userDir = userDir + separator + "src" + separator + "main";
|
||||||
|
} else {
|
||||||
|
userDir = userDir + separator + "jodconverter-web" + separator + "src" + separator + "main";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return userDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCustomizedConfigPath() {
|
||||||
|
String homePath = OfficeUtils.getHomePath();
|
||||||
|
String separator = java.io.File.separator;
|
||||||
|
String configFilePath = homePath + separator + "config" + separator + "application.properties";
|
||||||
|
return configFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SpringBoot application.properties 支持从环境变量获取值
|
* SpringBoot application.properties 支持从环境变量获取值
|
||||||
@@ -14,12 +14,12 @@
|
|||||||
<artifactId>kkFileView</artifactId>
|
<artifactId>kkFileView</artifactId>
|
||||||
<version>2.2.1</version>
|
<version>2.2.1</version>
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<!-- required for org.hyperic:sigar -->
|
<!-- required for org.hyperic:sigar -->
|
||||||
@@ -35,18 +35,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>net.logstash.logback</groupId>
|
||||||
<artifactId>spring-boot-starter-jetty</artifactId>
|
<artifactId>logstash-logback-encoder</artifactId>
|
||||||
|
<version>4.11</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
@@ -54,7 +48,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.keking</groupId>
|
<groupId>cn.keking</groupId>
|
||||||
<artifactId>office-plugin</artifactId>
|
<artifactId>jodconverter-core</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -164,7 +158,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.thoughtworks.xstream</groupId>
|
<groupId>com.thoughtworks.xstream</groupId>
|
||||||
<artifactId>xstream</artifactId>
|
<artifactId>xstream</artifactId>
|
||||||
<version>1.4.15</version>
|
<version>1.4.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>19.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
|
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
|
||||||
@@ -193,14 +192,6 @@
|
|||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${basedir}/lib/aspose-cad-19.9.jar</systemPath>
|
<systemPath>${basedir}/lib/aspose-cad-19.9.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 编码识别 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cpdetector</groupId>
|
|
||||||
<artifactId>cpdetector</artifactId>
|
|
||||||
<version>1.04</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${basedir}/lib/cpdetector-1.04.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<resources>
|
<resources>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user