startup.bat move to /WEB-INF/

This commit is contained in:
thinkgem
2018-04-07 21:48:00 +08:00
parent 4fa38828b0
commit ca56382b00
5 changed files with 42 additions and 55 deletions

View File

@@ -625,8 +625,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
}
zouts.closeEntry();
fin.close();
System.out
.println("添加文件 " + file.getAbsolutePath() + " 到zip文件中!");
logger.debug("添加文件 " + file.getAbsolutePath() + " 到zip文件中!");
} catch (Exception e) {
e.printStackTrace();
}
@@ -698,26 +697,6 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
* @return 返回错误信息无错误信息返回null
*/
public static String downFile(File file, HttpServletRequest request, HttpServletResponse response, String fileName){
String error = null;
if (file != null && file.exists()) {
if (file.isFile()) {
if (file.length() <= 0) {
error = "该文件是一个空文件。";
}
if (!file.canRead()) {
error = "该文件没有读取权限。";
}
} else {
error = "该文件是一个文件夹。";
}
} else {
error = "文件已丢失或不存在!";
}
if (error != null){
logger.debug("---------------" + file + " " + error);
return error;
}
long fileLength = file.length(); // 记录文件大小
long pastLength = 0; // 记录已下载文件大小
int rangeSwitch = 0; // 0从头开始的全文下载1从某字节开始的下载bytes=27000-2从某字节开始到某字节结束的下载bytes=27000-39000
@@ -778,7 +757,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
// 是从开始下载
logger.debug("---------------是从开始进行下载!");
}
try {
response.addHeader("Content-Disposition", "attachment; filename=\"" +
EncodeUtils.encodeUrl(StringUtils.isBlank(fileName) ? file.getName() : fileName) + "\"");