public File compress(File directory, File outputFile) throws IOException {
        try (var paths = Files.find(Path.of(directory.getAbsolutePath()), recurseDepth,
                                    (p, basicFileAttributes) -> basicFileAttributes.isRegularFile()))
        {
            return compress(directory, paths.map(Path::toFile).toList(), outputFile);
        }
    }
Utility class for compressing and decompressing files used in a file reference

@author hmusum
filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceCompressor.java