JDK-4419591 : ZipFile class does not understand compression method that WinZIP can process.
  • Type: Bug
  • Status: Resolved
  • Resolution: Won't Fix
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Priority: P4
  • Affected Version: 1.3.0
  • OS: windows_2000
  • CPU: x86
  • Submit Date: 2001-02-27
  • Updated Date: 2017-08-09
  • Resolved Date: 2017-08-09
Description

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) 
======================================================================

Comments
EVALUATION The zip file has the compression method "6 - The file is Imploded" which is not supported by existing jar/zip implementation.
2009-06-03