public static void zipFileList(String zipFileName, List<String> fileNameList) throws IOException {
List<File> fileList = new ArrayList<File>();
for(String fileName : fileNameList){
File f = new File(fileName);
fileList.add(f);
}
File zipFile = new File(zipFileName);
if (!zipFile.exists()) {
if (zipFile.getParentFile() != null
&& !zipFile.getParentFile().exists()) {
zipFile.getParentFile().mkdirs();
}
zipFile.createNewFile();
}
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile));
for(File f : fileList){
out.putNextEntry(new org.apache.tools.zip.ZipEntry(f.getName()));
FileInputStream in = new FileInputStream(f);
int b;
while ((b = in.read()) != -1) {
out.write(b);
}
in.close();
}
out.close();
}