private static void preserveModificationTimes(
      Path destination, List<ZipEntry> entries, boolean enableReproducibleTimestamps)
      throws IOException {
    if (enableReproducibleTimestamps) {
      FileTime epochPlusOne = FileTime.fromMillis(1000L);
      new DirectoryWalker(destination)
          .filter(Files::isDirectory)
          .walk(path -> Files.setLastModifiedTime(path, epochPlusOne));
    }
    for (ZipEntry entry : entries) {
      Files.setLastModifiedTime(destination.resolve(entry.getName()), entry.getLastModifiedTime());
    }
  }
Preserve modification time of files and directories in a zip file. If a directory is not an
entry in the zip file and reproducible timestamps are enabled then its modification timestamp
is set to a constant value.

@param destination target root for unzipping
@param entries list of entries in zip file
@param enableReproducibleTimestamps whether or not reproducible timestamps should be used
@throws IOException when I/O error occurs
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ZipUtil.java