java压缩文件工具类免费下载
解决方法:
1.使用方法
String id = StringUtil.getid();
String tempPath = System.getProperty("catalina.home") + "/temp/"+ id + "/" ;
String zippath = System.getProperty("catalina.home") + "/temp/" + id + ".zip";//压缩包,把xls文件压缩到zip中,在浏览器下载
File zipfile = new File(zippath);
FileOutputStream fos1 = new FileOutputStream(zipfile);
ZipUtils.toZip(tempPath, fos1, true);//tempPath目录中的文件打包到zip中