fix encodeUrlFileName method

pull/154/head
陈精华 2 years ago
parent 7f9f402a82
commit bfe4f73b49
No known key found for this signature in database
GPG Key ID: 30BDC970902B755D

@ -1,5 +1,5 @@
FROM keking/kkfileview-jdk:latest FROM keking/kkfileview-jdk:latest
MAINTAINER chenjh "842761733@qq.com" MAINTAINER chenjh "842761733@qq.com"
ADD server/target/kkFileView-*.tar.gz /opt/ ADD server/target/kkFileView-*.tar.gz /opt/
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.3.0-SNAPSHOT/bin ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.3.0/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"] 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"]

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

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

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

Loading…
Cancel
Save