public void compress(String srcPathName) {
File file = new File(srcPathName);
if (!file.exists()) {
- throw new RuntimeException(srcPathName + "not exist!");
+ throw new RuntimeException(srcPathName + "not exist!");
}
try {
FileOutputStream fileOutputStream = new FileOutputStream(zipFile);
private void compress(File file, ZipOutputStream out, String basedir) {
if (file.isDirectory()) {
- System.out.println("compress:" + basedir + file.getName());
+ System.out.println("compress: " + basedir + file.getName());
this.compressDirectory(file, out, basedir);
} else {
- System.out.println("compress:" + basedir + file.getName());
+ System.out.println("compress: " + basedir + file.getName());
this.compressFile(file, out, basedir);
}
}
}
}
if (!flag) {
- String message = "Copy catagory " + srcDirName + " to " + destDirName + " failed!";
+ String message = "Copy catagory " + srcDirName + " to " + destDirName + " failed!";
LOGGER.error(message);
return false;
} else {
File srcFile = new File(srcFileName);
if (!srcFile.exists()) {
- String message = "Source file :" + srcFileName + " not exist !";
+ String message = "Source file : " + srcFileName + " not exist !";
LOGGER.error(message);
return false;
} else if (!srcFile.isFile()) {
OutputStream outputStream = null;
try {
File locaFile = new File(relativeLocalPath + ftpFile.getName());
- // 判断文件是否存在,存在则返回
if (locaFile.exists()) {
return;
} else {
outputStream.close();
}
} catch (IOException e1) {
- logger.error("输出文件流异常");
+ logger.error("OutputStream error !");
}
}
}