Extractor { public List<File> uncompress(String inputFile, String outputDir, Consumer<ProgressEntity> onChange) { return uncompress(new File(inputFile), new File(outputDir), onChange); } Extractor(FileAnalyser fileAnalyser, Tar tar, Zip zip); List<File> uncompress(String inputFile, String outputDir, Consumer<ProgressEntity> onChange); List<File> uncompress(File inputFile, File outputDir, Consumer<ProgressEntity> onChange);  }
@Test public void testUncompressWithSymbolicLinks() throws IOException, URISyntaxException { File inputFile = new File(inputUrl.toURI().getPath(), "tarLink.tar.gz"); final File temporaryDirectory = Files.createTempDir(); temporaryDirectory.deleteOnExit(); final List<File> extractedFiles = extractor.uncompress(inputFile, temporaryDirectory, e -> { }); final File file1 = new File(temporaryDirectory, "file1.txt"); final File file2 = new File(temporaryDirectory, "file1_link.txt"); assertTrue(file1.exists()); assertTrue(file2.exists()); assertEquals("file1content", new String(FileUtils.readFileToByteArray(file1))); assertEquals("file1content", new String(FileUtils.readFileToByteArray(file2))); assertTrue(java.nio.file.Files.isSymbolicLink(Paths.get(file2.getPath()))); }