|
|
@@ -3,6 +3,8 @@ package thyyxxk.webserver.utils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import java.io.*;
|
|
|
+import java.nio.file.Files;
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.util.zip.ZipEntry;
|
|
|
import java.util.zip.ZipInputStream;
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
@@ -46,7 +48,7 @@ public class ZipUtil {
|
|
|
public static String unZip(String filename) throws IOException {
|
|
|
String unZipPath = "";
|
|
|
//读取压缩文件
|
|
|
- ZipInputStream in = new ZipInputStream(new FileInputStream(filename));
|
|
|
+ ZipInputStream in = new ZipInputStream(Files.newInputStream(Paths.get(filename)));
|
|
|
//zip文件实体类
|
|
|
ZipEntry entry;
|
|
|
//遍历压缩文件内部 文件数量
|