管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-27 6e15fb58d1530c5dc28be872f950b2d5758246f8
src/main/java/com/lf/server/helper/ZipHelper.java
@@ -30,9 +30,13 @@
    public static boolean unzip(String filePath, String zipDir) {
        ZipFile zipFile = null;
        try {
            File dir = new File(zipDir);
            if (!dir.exists() || !dir.isDirectory()) {
                dir.mkdirs();
            }
            int count;
            zipFile = new ZipFile(filePath);
            Enumeration e = zipFile.entries();
            while (e.hasMoreElements()) {
                ZipEntry entry = (ZipEntry) e.nextElement();
@@ -47,7 +51,6 @@
                BufferedInputStream is = new BufferedInputStream(zipFile.getInputStream(entry));
                FileOutputStream fos = new FileOutputStream(zipDir + File.separator + entry.getName());
                BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER_SIZE);
                while ((count = is.read(BUFFER, 0, BUFFER_SIZE)) != -1) {
                    dest.write(BUFFER, 0, count);
                }