diff --git a/commons-doc-server-netty/src/main/java/org/fortune/doc/server/support/DocServerHandler.java b/commons-doc-server-netty/src/main/java/org/fortune/doc/server/support/DocServerHandler.java index 99caaff..e60f4b6 100644 --- a/commons-doc-server-netty/src/main/java/org/fortune/doc/server/support/DocServerHandler.java +++ b/commons-doc-server-netty/src/main/java/org/fortune/doc/server/support/DocServerHandler.java @@ -17,6 +17,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; import java.net.URI; /** @@ -283,6 +284,7 @@ private void writeMenu(MessageEvent e) { } static { + createFileBaseDirectoryIfNotExist(); org.jboss.netty.handler.codec.http.multipart.DiskFileUpload.deleteOnExitTemporaryFile = false; org.jboss.netty.handler.codec.http.multipart.DiskFileUpload.baseDirectory = DocServerContainer .getInstance().getFileBaseDirectory(); @@ -291,4 +293,12 @@ private void writeMenu(MessageEvent e) { .getInstance().getFileBaseDirectory(); } + //2019.06.16 修复【系统找不到指定路径】的异常问题 + private static void createFileBaseDirectoryIfNotExist() { + String fileDir = DocServerContainer.getInstance().getFileBaseDirectory(); + File dirFolder = new File(fileDir); + + if (!dirFolder.exists()) + dirFolder.mkdirs(); + } } diff --git a/commons-doc-server-netty/src/main/resources/config/doc-server.yml b/commons-doc-server-netty/src/main/resources/config/doc-server.yml index 7958270..be5ae4f 100644 --- a/commons-doc-server-netty/src/main/resources/config/doc-server.yml +++ b/commons-doc-server-netty/src/main/resources/config/doc-server.yml @@ -14,4 +14,4 @@ accounts: thumbHeight: 100 thumbWidth: 100 port: 9999 #端口号 -fileBaseDirectory: C:\06_temp\upload\tmp #临时文件的目录 \ No newline at end of file +fileBaseDirectory: C:\06_temp\up\tmp #临时文件的目录 \ No newline at end of file diff --git a/commons-doc-server-netty/src/main/webapp/META-INF/MANIFEST.MF b/commons-doc-server-netty/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/commons-doc-server-netty/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/commons-doc-server-netty/src/main/webapp/index.jsp b/commons-doc-server-netty/src/main/webapp/index.jsp new file mode 100644 index 0000000..e24eb9b --- /dev/null +++ b/commons-doc-server-netty/src/main/webapp/index.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Commons-Doc-Server + + +静态资源服务器部署成功 + + \ No newline at end of file