469,569 Members | 1,514 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,569 developers. It's quick & easy.

Obtaining an InputStream within an InputStream

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
1 4397
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.

Similar topics

5 posts views Thread by Seong Jin, Cho | last post: by
1 post views Thread by Charles.Deisler | last post: by
reply views Thread by bvasanth123 | last post: by
reply views Thread by bvasanth123 | last post: by
1 post views Thread by samtilden | last post: by
11 posts views Thread by John Krukoff | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.