提交 1a660782 authored 作者: lizhuo's avatar lizhuo

--no commit message

上级 9f24c36c
......@@ -227,7 +227,9 @@ public class FTPController {
fiList.forEach(fi -> {
String path = rootPath + fi.getPath() + "/" + fi.getFileName() + fi.getSuffixName();
try {
ZipUtil.compress(out, new File(path), file.getName());
if(new File(path).exists()) {
ZipUtil.compress(out, new File(path), file.getName());
}
} catch (Exception e) {
throw new BaseException("压缩资源文件失败");
}
......@@ -242,7 +244,9 @@ public class FTPController {
fiList.forEach(fi -> {
String path = rootPath + fi.getPath() + "/" + fi.getFileName() + fi.getSuffixName();
try {
ZipUtil.compress(out, new File(path), file.getName());
if(new File(path).exists()) {
ZipUtil.compress(out, new File(path), file.getName());
}
} catch (Exception e) {
throw new BaseException("压缩附件失败");
}
......@@ -252,7 +256,10 @@ public class FTPController {
String strremoteDirectoryPath = ftpPath + sdv.getPath() + "/" + type;
String filePath = strremoteDirectoryPath;
File sourceFile = new File(filePath);
ZipUtil.compress(out, sourceFile, file.getName() + "/" + sourceFile.getName());
if(sourceFile.exists()) {
ZipUtil.compress(out, sourceFile, file.getName() + "/" + sourceFile.getName());
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论