| | |
| | | ZipInputStream zipInputStream = null; |
| | | try{ |
| | | FileInputStream inputStream = new FileInputStream(zipFileName); |
| | | zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream), StandardCharsets.ISO_8859_1); |
| | | zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream), Charset.forName("GBK")); |
| | | java.util.zip.ZipEntry ze; |
| | | List<FileMessage> list = new ArrayList<>(); |
| | | //循环遍历 |
| | |
| | | ZipFile zip = new ZipFile(zipFile, Charset.forName("GBK")); |
| | | for(Enumeration entries = zip.entries(); entries.hasMoreElements();){ |
| | | ZipEntry entry = (ZipEntry)entries.nextElement(); |
| | | if (!entry.isDirectory()) { |
| | | InputStream in = zip.getInputStream(entry); |
| | | //输出文件路径信息 |
| | | FileMessage fileMessage=new FileMessage(); |
| | |
| | | list.add(fileMessage); |
| | | in.close(); |
| | | } |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |