code:     private static void unzip(final ZipFile zip, final Path targetDir) throws IOException {
          final Enumeration<? extends ZipEntry> entries = zip.entries();
          while (entries.hasMoreElements()) {
              final ZipEntry entry = entries.nextElement();
              final String name = entry.getName();
              final Path current = targetDir.resolve(name);
              if (entry.isDirectory()) {
                  if (!Files.exists(current)) {
                      Files.createDirectories(current);
                  }
              } else {
                  if (Files.notExists(current.getParent())) {
                      Files.createDirectories(current.getParent());
                  }
                  try (final InputStream eis = zip.getInputStream(entry)) {
                      Files.copy(eis, current);
                  }
              }
              try {
                  Files.getFileAttributeView(current, BasicFileAttributeView.class).setTimes(entry.getLastModifiedTime(), entry.getLastAccessTime(), entry.getCreationTime());
              } catch (IOException e) {
                  //ignore, if we cannot set it, world will not end
              }
          }
      }
  
  