ArchiveFileUtils { public static URI toTarUri(URI parent, String tarEntry) { return toUri(parent, tarEntry, ImageType.TAR); } private  ArchiveFileUtils(); static URI toZipUri(URI parent, String zipEntry); static URI toIsoImageUri(URI parent, String imageEntry); static URI toRarUri(URI parent, String rarEntry); static URI toTarUri(URI parent, String tarEntry); static URI toSevenZUri(URI parent, String sevenZipEntry); static URI toFatImageUri(URI parent, String fatEntry); static URI toWebArchiveUri(String archiveType, URI parent, String warcEntry); static Path writeEntryToTemp(final Path tempDir, final ByteBuffer buffer,
                                        final ReadableByteChannel channel); static Path writeFsFileToTemp(final FsDirectoryEntry fsFile, final Path tempDir); static Path writeEntryToTemp(final Path tempDir, final byte[] buffer,
                                        final InputStream in); static URI toGZipUri(URI parent); static URI toBZipUri(URI parent); static URI toReplayUri(URI requestUri); static List<String> getAncestorPaths(String path); static int copyToBuffer(final WindowReader reader, final long position,
                                   final byte[] buffer, final int offset, final int length); static int copyToBuffer(final WindowReader reader, final long position,
                                   final ByteBuffer buffer);  }
@Test public void testBuildTarGzUri() throws URISyntaxException { URI parent = new URI("gz:http: String entryName = "path/in tar/README.txt"; assertEquals("tar:gz:http: ArchiveFileUtils.toTarUri(parent, entryName).toString()); }
@Test public void testBuildTarGzUriWithSpacesInEntry() { URI parent = URI.create("gz:http: String entryName = "path/in/tar/READ ME.txt"; assertEquals("tar:gz:http: ArchiveFileUtils.toTarUri(parent, entryName).toString()); }