Details
Description
TarArchiveEntry.getDirectoryEntries() always returns an empty array. This is because entry.getFile() returns null for a directory entry.
Let folder.tar be a Tar Archive which contains a folder, and that folder contains a file. Consider the following snippet:
import java.io.FileInputStream;
import org.apache.commons.compress.archivers.tar.*;
public class GetDirectoryEntriesBug {
public static void main(String[] args) throws Exception {
TarArchiveInputStream tais = new TarArchiveInputStream(new FileInputStream("folder.tar"));
for(TarArchiveEntry entry; (entry = tais.getNextTarEntry()) != null; )
tais.close();
}
}
Output:
Name: folder/file, isDirectory: false, getDirectoryEntries().length: 0
Name: folder/, isDirectory: true, getDirectoryEntries().length: 0
I expected that, for "folder/", getDirectoryEntries() will not return an empty array.