0

Specifically what I am trying to do is to list the contents of a jar which is inside a tar.

Well let me be even more specific. I have a situation where I have a tar file, inside this tar file is a series of other tar files, inside these tar files there are jar files and inside these jar files there may be other jar files. Ideally I would love to be able to do is a) list all jar files which sit inside the inner tar files and b) list the jar files that then may be present within these jar files.

Ideally I would like to do this with as little unarchiving as possible. So far I have been able to list all jar files that are present in the inner tar files by unarchiving the outer tar file. As far as I can see I would have to at least unarchive the inner tar files or the individual first layer of jar files to be able to list all inner jar files present there.

Any possible solution involving Java/Groovy or even linux command line would be most welcome.

Paul Kenny
  • 41
  • 1
  • 1
  • 4
  • May be a duplicate of http://stackoverflow.com/questions/5396884/how-to-listfiles-from-jar-in-a-tar-by-using-truezip-in-java/5397795#5397795 ? – Tobias Otto Feb 20 '17 at 17:14
  • The question may be similar but the answer does not work for me. I have tried using both Zipfile.entries() and the Apache Commons Compress Tar and jar functionality but these both only succeed in listing the contents of the respective archives rather than the content of the archived archives, which is in essence what I need. – Paul Kenny Feb 20 '17 at 18:18

0 Answers0