JSP学习笔记(一百):truezip使用入门
1.truezip说明
truezip是一个开源项目,用来以编程的方式压缩/解压缩zip格式的文件,操作非常简单
2.truezip下载
下载地址:https://truezip.dev.java.net/servlets/ProjectDocumentList
文档地址:https://truezip.dev.java.net/manual-6.html
3.truezip使用
压缩文件:
File src = new File("D:\\jp\\app.exe");
File dst = new File("D:\\jp.zip\\app_rename.exe");
boolean success = src.copyAllTo(dst);
File dst = new File("D:\\jp.zip\\app_rename.exe");
boolean success = src.copyAllTo(dst);
解压缩文件:
File src = new File("D:\\jp.zip");
File dst = new File("D:\\jpa");
boolean success = src.copyAllTo(dst);
压缩文件夹:
File dst = new File("D:\\jpa");
boolean success = src.copyAllTo(dst);
File src = new File("D:\\jp");
File dst = new File("D:\\jp.zip");
boolean success = src.copyAllTo(dst);
解压缩文件夹:
File dst = new File("D:\\jp.zip");
boolean success = src.copyAllTo(dst);
File src = new File("D:\\jp.zip");
File dst = new File("D:\\ap");
boolean success = src.copyAllTo(dst);
File dst = new File("D:\\ap");
boolean success = src.copyAllTo(dst);