How do I list the contents of a compressed tar file in Java without extracting the files? I have looked at apache ant api, and I can see how to extract files, but I cannot work out how to just list them. The tar files are either bz2 or gz.
Share
I recommend using TrueZIP. It’s really good.
It’s an excellent, fast library. It has TAR drivers, and can handle
*.tar.gzand*.tar.bz2files. The JavaDocs are clear and complete, though I found the standalone tutorials insufficient – I had to read the JavaDoc to get things working.…Which brings me to the only downside I found: it might take a little while to wrap your head around TrueZIP. Initially, I had issues getting anything to work, but it “clicked” after a little while and I had no more difficulties.