@Test public void unzip_can_be_executed_multiple_times() throws IOException { File toDir = temp.newFolder(); ZipUtils.unzip(zip, toDir); ZipUtils.unzip(zip, toDir); assertThat(toDir.list()).hasSize(3); }
public static void unzip(File zip, File toDir) { try { if (!toDir.exists()) { FileUtils.forceMkdir(toDir); } } catch (Exception e) { throw new IllegalStateException("Fail to create folder " + toDir, e); } if (SystemUtils.IS_OS_WINDOWS) { javaUnzip(zip, toDir); } else { nativeUnzip(zip, toDir); } }
ZipUtils { public static void unzip(File zip, File toDir) { try { if (!toDir.exists()) { FileUtils.forceMkdir(toDir); } } catch (Exception e) { throw new IllegalStateException("Fail to create folder " + toDir, e); } if (SystemUtils.IS_OS_WINDOWS) { javaUnzip(zip, toDir); } else { nativeUnzip(zip, toDir); } } }
ZipUtils { public static void unzip(File zip, File toDir) { try { if (!toDir.exists()) { FileUtils.forceMkdir(toDir); } } catch (Exception e) { throw new IllegalStateException("Fail to create folder " + toDir, e); } if (SystemUtils.IS_OS_WINDOWS) { javaUnzip(zip, toDir); } else { nativeUnzip(zip, toDir); } } private  ZipUtils(); }
ZipUtils { public static void unzip(File zip, File toDir) { try { if (!toDir.exists()) { FileUtils.forceMkdir(toDir); } } catch (Exception e) { throw new IllegalStateException("Fail to create folder " + toDir, e); } if (SystemUtils.IS_OS_WINDOWS) { javaUnzip(zip, toDir); } else { nativeUnzip(zip, toDir); } } private  ZipUtils(); static void unzip(File zip, File toDir); }
ZipUtils { public static void unzip(File zip, File toDir) { try { if (!toDir.exists()) { FileUtils.forceMkdir(toDir); } } catch (Exception e) { throw new IllegalStateException("Fail to create folder " + toDir, e); } if (SystemUtils.IS_OS_WINDOWS) { javaUnzip(zip, toDir); } else { nativeUnzip(zip, toDir); } } private  ZipUtils(); static void unzip(File zip, File toDir);  }