Browse Source

fix encodeUrlFileName method

pull/154/head
陈精华 2 years ago
parent
commit
bfe4f73b49
No known key found for this signature in database
GPG Key ID: 30BDC970902B755D
  1. 4
      Dockerfile
  2. 2
      pom.xml
  3. 4
      server/pom.xml
  4. 3
      server/src/main/java/cn/keking/utils/WebUtils.java

4
Dockerfile

@ -1,5 +1,5 @@
FROM keking/kkfileview-jdk:latest
MAINTAINER chenjh "842761733@qq.com"
ADD server/target/kkFileView-*.tar.gz /opt/
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.3.0-SNAPSHOT/bin
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.3.0-SNAPSHOT/config/application.properties","-jar","/opt/kkFileView-4.3.0-SNAPSHOT/bin/kkFileView-4.3.0-SNAPSHOT.jar"]
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.3.0/bin
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.3.0/config/application.properties","-jar","/opt/kkFileView-4.3.0/bin/kkFileView-4.3.0.jar"]

2
pom.xml

@ -6,7 +6,7 @@
<groupId>cn.keking</groupId>
<artifactId>kkFileView-parent</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>4.3.0</version>
<properties>
<java.version>1.8</java.version>

4
server/pom.xml

@ -6,7 +6,7 @@
<parent>
<artifactId>kkFileView-parent</artifactId>
<groupId>cn.keking</groupId>
<version>4.3.0-SNAPSHOT</version>
<version>4.3.0</version>
</parent>
<artifactId>kkFileView</artifactId>
@ -336,7 +336,7 @@
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/dist-win32.xml</descriptor>
<!-- <descriptor>src/main/assembly/dist-win32.xml</descriptor>-->
<descriptor>src/main/assembly/dist-linux.xml</descriptor>
</descriptors>
</configuration>

3
server/src/main/java/cn/keking/utils/WebUtils.java

@ -157,6 +157,9 @@ public class WebUtils {
String noQueryUrl = url.substring(0, url.contains("?") ? url.indexOf("?") : url.length());
int fileNameStartIndex = noQueryUrl.lastIndexOf('/') + 1;
int fileNameEndIndex = noQueryUrl.lastIndexOf('.');
if (fileNameEndIndex < fileNameStartIndex) {
return url;
}
try {
encodedFileName = URLEncoder.encode(noQueryUrl.substring(fileNameStartIndex, fileNameEndIndex), "UTF-8");
} catch (UnsupportedEncodingException e) {

Loading…
Cancel
Save