class MoreFiles {

    public static void extractZip(File zip, File toDir) throws IOException {
        try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zip))) {
            ZipEntry entry;
            while ((entry = zis.getNextEntry()) != null) {
                if (!entry.isDirectory()) {
                    File file = new File(toDir, entry.getName());
                    createParentDirs(file);
                    Files.copy(zis, file.toPath());
                    zis.closeEntry();
                }
            }
        }
    }

}