@Override
  public void close() {
    for (Path path : directories) {
      if (Files.exists(path)) {
        try {
          MoreFiles.deleteRecursively(path, RecursiveDeleteOption.ALLOW_INSECURE);
        } catch (IOException ignored) {
          // ignored
        }
      }
    }
    directories.clear();
  }
Creates a new temporary directory.

@param parentDirectory the directory to create the temp directory inside
@return the path to the temporary directory
@throws IOException if creating the directory fails
jib-core/src/main/java/com/google/cloud/tools/jib/filesystem/TempDirectoryProvider.java