By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,514 Members | 1,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,514 IT Pros & Developers. It's quick & easy.

Obtaining an InputStream within an InputStream

P: n/a
I have the need to read a file (version.txt) that is embedded within an
WAR file that is within an EAR file: foo.ear contains bar.war contains
resources/version.txt

I am able to get the bar.ear file as an inputstream as follows:

import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

ZipFile zipFile = new ZipFile("foo.ear");
ZipEntry zipEntry = zipFile.getEntry("bar.war");
InputStream barWarStream = zipFile.getInputStream(zipEntry);

Are there any utilities are available in Java such that I can get the
resources/version.txt extracted from the barWarStream as a separate
input stream?
Nov 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
O.B. wrote:
I have the need to read a file (version.txt) that is embedded within an
WAR file that is within an EAR file: foo.ear contains bar.war contains
resources/version.txt

I am able to get the bar.ear file as an inputstream as follows:

import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

ZipFile zipFile = new ZipFile("foo.ear");
ZipEntry zipEntry = zipFile.getEntry("bar.war");
InputStream barWarStream = zipFile.getInputStream(zipEntry);

Are there any utilities are available in Java such that I can get the
resources/version.txt extracted from the barWarStream as a separate
input stream?
Sorry, but you're in the wrong group. This is a JavaScript group, and
you're looking for information about Java which is entirely unrelated.
Try comp.lang.java.help or alt.comp.lang.java.
Nov 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.