• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting info from a file inside an ear/war file.

 
Jeff Strike
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have several war files inside an ear.
I need to get info from the mainifest file inside each war file.

I can open the ear file and find the war file entries easy enough with the ZipFile class, but is it possible to open the manifest.mf inside each war file without first unpacking the war from the ear?

Thanks,
-Jeff
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call the ZipFile's getInputStream(ZipEntry) method. This returns a raw input stream for that entry only. You can then wrap that input stream into a ZipInputStream:
Note how I simply read from the ZipInputStream. That's how ZipInputStream works; after each call to getNextEntry(), the ZipInputStream is reset to start reading from that entry only.
 
Jeff Strike
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sweet. I never saw ZipInputStream.

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic