Name: boT120536 Date: 02/27/2001
C:\WINNT>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The class ZipFile is not able to open a 'zip' file that WinZIP can successfully
process.
Here is the URL to the sample zip file I am attempting to unzip.
http://www.tsnhorse.com/samples/evd0619i.zip
I downloaded this file to my local temp directory, then attempted to open it
with the code:
private void unzipFile(String filename) {
try {
ZipFile z = new ZipFile(filename);
}
catch (Exception e) {
e.printStackTrace();
}
This code produces the stack trace:
java.util.zip.ZipException: invalid CEN header (bad compression method)
at java.util.zip.ZipFile.<init>(ZipFile.java:110)
Using WinZIP, I can open and extract the zip file contents. If I then re-
create the zip file using WinZIP, the above code completes without generating
an exception.
(Review ID: 117713)
======================================================================