JDK-4419591 : ZipFile class does not understand compression method that WinZIP can process.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2001-02-27
  • Updated: 2017-08-09
  • Resolved: 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.
03-06-2009