I am using commons-compress to process tarball files and noticed that even files which are not tar seem to be processed. Why is this -- is there a better library to detect valid tar files
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.20</version>
</dependency>
bug689.csv
is a CSV file, the test fails because apparently te.isFile() returns true. te.getName() seems to return the contents of the CSV. Is this a bug of am I using the package incorrectly -- I'd expect the InputStream to not be successfully converted to TarArchiveEntry
@Test
public void testTarball() throws IOException{
InputStream tarData = this.getClass().getResourceAsStream("/bug689.csv");
TarArchiveInputStream tis = new TarArchiveInputStream(tarData);
TarArchiveEntry te = tis.getNextTarEntry();
assertFalse(te.isFile());
}