473,657 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Z ipEntry;
import java.util.zip.Z ipFile;

ZipFile zipFile = new ZipFile("foo.ea r");
ZipEntry zipEntry = zipFile.getEntr y("bar.war");
InputStream barWarStream = zipFile.getInpu tStream(zipEntr y);

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 4577
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.Z ipEntry;
import java.util.zip.Z ipFile;

ZipFile zipFile = new ZipFile("foo.ea r");
ZipEntry zipEntry = zipFile.getEntr y("bar.war");
InputStream barWarStream = zipFile.getInpu tStream(zipEntr y);

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.j ava.
Nov 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8531
by: Seong Jin, Cho | last post by:
Hi. Is there a way to get an unbuffered InputStream from Process? I found out that java.lang.Win32Process and java.lang.UNIXProcess both wraps the stdout with java.io.BufferedInputStream, but I need an unbuffered one.
7
21289
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a question about PHP, perl, VBScript, Java(.class), or ActiveX. Let us _only_ deal with JavaScript for...
1
2115
by: Charles.Deisler | last post by:
XmlTextReader requestdata = new XmlTextReader(Request.InputStream); XmlTextWriter xmltextwriter = new XmlTextWriter(somefile,someencoding); XmlTextWriter xmltextwriter2 = new XmlTextWriter(somefile2,someencoding); xmltextwriter.WriteNode(requestdata, false); // i want to write to another writer here by resetting the reader xmltextwriter2.WriteNode(requestdata, false);
3
3054
by: Biff | last post by:
Hello, I am bringing up an iFrame with a calendar control in it in coordination with a text box that holds a date field. In my code behind class I add a method call to the text box's OnFocus event that calls the javascript method that shows and positions the iFrame (arguments are the text control, and the desired x and y coordinates of the iFrame). Right now I use hardcoded fixed values for the calendar location - it was expedient and...
0
2197
by: bvasanth123 | last post by:
Hi, I would like to know how can I read an InputStream into Excel object. In my web app, user uploads MS-Excel file though asp.net html file control. I get UploadedFile.PostedFile.InputStream() where UploadedFile is the name of file control. Not I have InputStream. How can I read into Excel object for parsing as excel file. Regards, Vasanth
0
1617
by: bvasanth123 | last post by:
Hi, I would like to know how can I read an InputStream into Excel object. In my web app, user uploads MS-Excel file though asp.net html file control. I get UploadedFile.PostedFile.InputStream() where UploadedFile is the name of file control. Not I have InputStream. How can I read into Excel object for parsing as excel file. (Language VB.NET) Regards, Vasanth
1
8102
by: samtilden | last post by:
I want to print out some tracing messages from Global.asax.cs/Application_BeginRequest(). I easily got: System.Web.HttpContext.Current.Request.RawUrl, and System.Web.HttpContext.Current.Request.Params. I would now like to get the entire:
0
1232
by: raheel javed | last post by:
i am using mobile for communication with live server when mobile send its information to server the input stream is encoded in utf-8 that is converted into string but it is still not understandable so chk it what should i do to convert such type of data Stream str; string strmContents= ""; int counter, strLen, strRead;
11
1621
by: John Krukoff | last post by:
-----Original Message----- First off, ignore castironpi, it's a turing test failure. Second, I'm curious as to how Java manages this. I'd think their streams would have to be pretty magic to pull this off after the HTTP connection has already been built. Anyway, as I see it, this is more of a HTTP protocol question. I think what you need to do is set the HTTP Range header to bytes=-128, see the urllib2
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.