* @throws Exception
*/
public static void zip(FileSystem fs,String sourceFolder1, FileSystem fs2,String zipFilePath2) throws Exception {
OutputStream out = fs2.create(new Path(zipFilePath2),true);
BufferedOutputStream bos = new BufferedOutputStream(out);
ZipOutputStream zos = new ZipOutputStream(bos);
// 解决中文文件名乱码
zos.setEncoding(CHINESE_CHARSET);
Path basePath = null;
Path src=new Path(sourceFolder1);
FileStatus f=fs.getFileStatus(src);
if (f.isDir()) {
basePath =f.getPath();
} else {
basePath = f.getPath().getParent();
}
zipFile(fs,f, basePath, zos);
zos.closeEntry();
zos.close();
bos.close();
out.close();
}