@Test
public void testExtractTgz() throws Exception {

    //TIKA-2564
    File tempFile = File.createTempFile("tika-test-", "");
    assertTrue(tempFile.delete());
    assertTrue(tempFile.mkdir());
    try {
        String[] params = {"--extract-dir="+tempFile.getAbsolutePath(),"-z", resourcePrefix + "/test-documents.tgz"};
        TikaCLI.main(params);
        String[] tempFileNames = tempFile.list();
        assertNotNull(tempFileNames);
        String allFiles = String.join(" : ", tempFileNames);
        File expectedTAR = new File(tempFile, "test-documents.tar");
        assertExtracted(expectedTAR, allFiles);
    } finally {
        FileUtils.deleteDirectory(tempFile);
    }
}