Skip to content

Commit

Permalink
Merge pull request #21 from landy8530/1.0.3.1
Browse files Browse the repository at this point in the history
Fixed a bug for IOException since the FileBaseDirectory not exists
  • Loading branch information
landy8530 authored Jun 16, 2019
2 parents 086da93 + 049c514 commit 9d65bee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.net.URI;

/**
Expand Down Expand Up @@ -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();
Expand All @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ accounts:
thumbHeight: 100
thumbWidth: 100
port: 9999 #端口号
fileBaseDirectory: C:\06_temp\upload\tmp #临时文件的目录
fileBaseDirectory: C:\06_temp\up\tmp #临时文件的目录
3 changes: 3 additions & 0 deletions commons-doc-server-netty/src/main/webapp/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

12 changes: 12 additions & 0 deletions commons-doc-server-netty/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Commons-Doc-Server</title>
</head>
<body>
静态资源服务器部署成功
</body>
</html>

0 comments on commit 9d65bee

Please sign in to comment.