docs: public static CompressedDirectory create(final Path directory) throws IOException {
      final Path file = Files.createTempFile("docker-client-", ".tar.gz");
  
      final Path dockerIgnorePath = directory.resolve(".dockerignore");
      final ImmutableList<DockerIgnorePathMatcher> ignoreMatchers =
          parseDockerIgnore(dockerIgnorePath);
  
      try (final OutputStream fileOut = Files.newOutputStream(file);
           final GzipCompressorOutputStream gzipOut = new GzipCompressorOutputStream(fileOut);
           final TarArchiveOutputStream tarOut = new TarArchiveOutputStream(gzipOut)) {
        tarOut.setLongFileMode(LONGFILE_POSIX);
        tarOut.setBigNumberMode(BIGNUMBER_POSIX);
        Files.walkFileTree(directory,
                           EnumSet.of(FileVisitOption.FOLLOW_LINKS),
                           Integer.MAX_VALUE,
                           new Visitor(directory, ignoreMatchers, tarOut));
  
      } catch (Throwable t) {
        // If an error occurs, delete temporary file before rethrowing exclude.
        try {
          Files.delete(file);
        } catch (IOException e) {
          // So we don't lose track of the reason the file was deleted... might be important
          t.addSuppressed(e);
        }
  
        throw t;
      }
  
      return new CompressedDirectory(file);
    }