This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am trying to solve the following problem. I am developing a Java application on a Windows machine; the data for this application resides in an Unix server (which I can usually browse using a SSH connection in a putty console). Now, my problem is: I would to access the data in this server, the data are contained in zip files (there is one entry per each each zip, currently). I found this package, jsch-0.1.33, which allows you to obtain an InputStream for the zip file, you can wrap it in a ZipInputStream, and from this object you can retrieve the entries, but how can I retrieve the InputStream from each entry? Note that, differently from what I am used to do in my local machine, I can't instantiate the remote ZipFile object, I can only get the OutputStream.
Is this possible to do? Am I using a wrong package for my purpose? Do you know any other solution?
Thanks in advance
Joined: May 03, 2006
I sorted out the problem myself. Within the JSch package, once I get the InputStream for the zip file out the Channel object, I can get and read a stream for the ZipEntry in this way: