日期:2014-05-20 浏览次数:20683 次
if(list != null && !list.isEmpty()){
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
out.putNextEntry(new org.apache.tools.zip.ZipEntry(base + "/"));
for(int i=0;i<list.size();i++){
out.putNextEntry(new org.apache.tools.zip.ZipEntry(((File)list.get(i)).getName()));
System.out.println(((File)list.get(i)).getName());
FileInputStream in = new FileInputStream((File)list.get(i));
int b;
while ( (b = in.read()) != -1) {
out.write(b);
}
in.close();
}
out.close();
}