读取zip文件信息

可以用于读取上传的zip文件信息

// ZipFile zf;
        try {
       // zf = new ZipFile(file);
        FileInputStream in = new FileInputStream(file);
        ZipInputStream zin = new ZipInputStream(in);  
        ZipEntry ze;while ((ze = zin.getNextEntry()) != null) {  
             if (ze.isDirectory()) {
             } else {  
                String name = ze.getName();
                logger.error("file - " + name + " : "  
                         + ze.getSize() + " bytes");  
                 ze.getName();continue;
             }  
         }  
         zin.closeEntry();  
         in.close();
         zin.close();
        } catch (IOException e) {
            e.printStackTrace();
        }  
原文地址:https://www.cnblogs.com/ShaoXin/p/7771864.html