|
@@ -119,6 +119,7 @@ public class FileDisposeUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static boolean fileToZip(String sourceFilePath, String zipFilePath,String fileName) {
|
|
|
+ logger.info("开始压缩"+sourceFilePath+"目录");
|
|
|
boolean flag = false;
|
|
|
File sourceFile = new File(sourceFilePath);
|
|
|
FileInputStream fis = null;
|
|
@@ -130,7 +131,7 @@ public class FileDisposeUtil {
|
|
|
logger.error("待压缩的文件目录:" + sourceFilePath + "不存在.");
|
|
|
} else {
|
|
|
try {
|
|
|
- File zipFile = new File(zipFilePath+"/"+fileName+".zip");
|
|
|
+ File zipFile = new File(zipFilePath+File.separator+fileName+".zip");
|
|
|
if (zipFile.exists()) {
|
|
|
logger.error(zipFilePath + "目录下存在名字为:" + fileName+ ".zip" + "打包文件.");
|
|
|
} else {
|
|
@@ -174,6 +175,7 @@ public class FileDisposeUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ logger.info("压缩"+sourceFilePath+"目录完成");
|
|
|
return flag;
|
|
|
}
|
|
|
|