日期:2014-05-17 浏览次数:20727 次
for(String str:allFiles){
String[] ary=str.split(":");
File f=new File(ary[0]);//ary[0]:uploadfiels/text.txt
FileInputStream fis=new FileInputStream(f);//此处debug模式没问题,正常启动报错,文件找不到,路径错误
zos.putNextEntry(new ZipEntry(ary[1]));
int j=0;
byte[] buffer=new byte[1024];
while((j=fis.read(buffer))>0){
zos.write(buffer,0,j);
}
fis.close();
}