This commit is contained in:
Looly
2022-07-29 23:48:40 +08:00
parent 99d1835e38
commit 2e349104a3
4 changed files with 17 additions and 6 deletions

View File

@@ -156,6 +156,7 @@ public class ZipUtilTest {
//https://github.com/dromara/hutool/issues/944
String dir = "d:/test";
String zip = "d:/test.zip";
//noinspection IOStreamConstructor
try (OutputStream out = new FileOutputStream(zip)){
//实际应用中, out 为 HttpServletResponse.getOutputStream
ZipUtil.zip(out, Charset.defaultCharset(), false, null, new File(dir));
@@ -200,9 +201,10 @@ public class ZipUtilTest {
}
@Test
public void SizeUnzip() throws IOException {
String zipPath = "F:\\BaiduNetdiskDownload\\demo.zip";
String outPath = "F:\\BaiduNetdiskDownload\\test";
@Ignore
public void sizeUnzipTest() throws IOException {
String zipPath = "e:\\hutool\\demo.zip";
String outPath = "e:\\hutool\\test";
ZipFile zipFile = new ZipFile(zipPath, Charset.forName("GBK"));
File file = new File(outPath);
// 限制解压文件大小为637KB