Can anyone tell me how to open a Zipfile from a URL into an InputStream?
Yeah, but the problem is, it's a automatically generated zipfile, so actually
it's a file with extension asp, that I guess I should rename to a .zip-file,
before opening it with the zip-object
--Erick
ZipFile zip = new ZipFile(new File("c:\\tmp\\zipfile"));
Because, what I'm getting trying to run this code, is:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:69)
at java.util.zip.ZipFile.<init>(ZipFile.java:84)
at Test.main(Test.java:17)
--erick
Erick Griffin wrote:
> No, haven't seen that one...! Have seen IOException, if there is something
> wrong with the file though. Sure the zip file you have was created under
> normal conditions and is it formatted right?! ZipExcp means something is
> hosed with the file itself!
>
> --erick
Yeah, well, the zip was created with an Active Server-script, parsing its output in
(Sorry, I never work with ASP, so I do not know how it works exactly, but my guess is
as good as any) zip-valid-format. It's working also, since when I'm downloading the
ASP-zipfile, I can unzip it myself using Winzip 7.0
Piet
Am 22.12.99, 07.45.15, schrieb Piet de Jong <pi...@businessnet.net> zum
Thema Re: Opening a URL-zipfile.:
> Erick Griffin wrote:
If you want to open a zip file on an internet server, it's not a file,
but an URL. So you need to open an URLConnection, get the InputStream
from it, and wrap that InputStream in a ZipInputStream. Then you can
access any File inside this ZIP. Wether the source is a 'real' file,
lying physically on the server or if it's generated by some program
doesn't matter.
--
*******************************************************
**** Karl Schmidt Karl_Schmidt at t-online dot de) ****
*** Java related Homepage (under construction): ***
** http://home.t-online.de/home/Karl_Schmidt **
* *
** New: Mastermind with better graphic interface **
*** Message created with StarOffice 5.1 (OS/2) ***
**** Do 23.Dez 99, 03:20:23 ****
*******************************************************
That's what I'd say, but it DOES, when the zipping-method is not compatible
with your own.
Am 23.12.99, 07.49.25, schrieb Piet de Jong <pi...@businessnet.net> zum
Thema Re: Opening a URL-zipfile.:
> >
Of course, but that's a different story :-)
At least you should be able to open the file and check the ZIP
version. Then go ahead and write your own decrompression algorythm...
:-)