日期:2014-05-20 浏览次数:20911 次
SmbFile smbFile = new SmbFile(zipFile);
System.out.println("smbFile:--"+zipFile);
SmbFileInputStream in = new SmbFileInputStream(smbFile);
ZipInputStream zip = new ZipInputStream(in);
ZipEntry entry = null;
boolean exist = false;
while((entry = zip.getNextEntry()) != null)
{
System.out.println(entry.getName());
if(entry.getName().equals(filename)){
response.setContentType("application/octet-stream");
response.setHeader("Content-disposition", "attachment; filename=" + filename);
OutputStream out = response.getOutputStream();
byte[] b = new byte[1024];
int n;
while((n = zip.read(b)) != -1)
{
out.write(b, 0, n);
}
out.flush();
out.close();
exist = true;
break;
}
}
zip.close();