@Test public void unZip() throws Exception { doCreateZipFile(); assertTrue(userHomeZip.exists()); RmZipHelper.unZip(userHomeZip.toString(), cgTestDir, RmZipHelper.ZIP_ENCODING_UTF8); assertTrue(new File(cgTestDir + File.separator + "中文.txt").exists()); new File(cgTestDir + File.separator + "abc.zip" ).delete(); new File(cgTestDir + File.separator + "a.txt" ).delete(); new File(cgTestDir + File.separator + "b.txt" ).delete(); new File(cgTestDir + File.separator + "中文.txt" ).delete(); assertTrue(!new File(cgTestDir + File.separator + "中文.txt").exists()); }
public static void unZip(String zipFile, String directory, String encoding) { try { extractFile(new ZipFile(new File(zipFile), ZipFile.OPEN_READ, Charset.forName(encoding)), directory); } catch (IOException e) { throw new RuntimeException("Failed to process ZIP file.", e); } }
RmZipHelper { public static void unZip(String zipFile, String directory, String encoding) { try { extractFile(new ZipFile(new File(zipFile), ZipFile.OPEN_READ, Charset.forName(encoding)), directory); } catch (IOException e) { throw new RuntimeException("Failed to process ZIP file.", e); } } }
RmZipHelper { public static void unZip(String zipFile, String directory, String encoding) { try { extractFile(new ZipFile(new File(zipFile), ZipFile.OPEN_READ, Charset.forName(encoding)), directory); } catch (IOException e) { throw new RuntimeException("Failed to process ZIP file.", e); } }  }
RmZipHelper { public static void unZip(String zipFile, String directory, String encoding) { try { extractFile(new ZipFile(new File(zipFile), ZipFile.OPEN_READ, Charset.forName(encoding)), directory); } catch (IOException e) { throw new RuntimeException("Failed to process ZIP file.", e); } }  static File createZipFile(File[] files, File target, String encoding); static void unZip(String zipFile, String directory, String encoding); static void extractFile(ZipFile archive, String extractDir); static File getExcelFromFile(File zipFile); }
RmZipHelper { public static void unZip(String zipFile, String directory, String encoding) { try { extractFile(new ZipFile(new File(zipFile), ZipFile.OPEN_READ, Charset.forName(encoding)), directory); } catch (IOException e) { throw new RuntimeException("Failed to process ZIP file.", e); } }  static File createZipFile(File[] files, File target, String encoding); static void unZip(String zipFile, String directory, String encoding); static void extractFile(ZipFile archive, String extractDir); static File getExcelFromFile(File zipFile); final static String ZIP_ENCODING_GBK; final static String ZIP_ENCODING_UTF8; final static int MAX_ZIP_SIZE; final static int MAX_TEMPLATE_SIZE; }