ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44913] New: zip unable to unzip file created by
Date Wed, 30 Apr 2008 19:28:40 GMT

           Summary: unable to unzip file created by
           Product: Ant
           Version: 1.7.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other

Created an attachment (id=21888)
 --> (
Source code to demonstrate the bug. The main class is ZipUtils.

I have a simple class that can compress and extract zip files using the classes
in the package The compression works fine and several zip
programs are able to read the file: Info-zip, ALZip, etc. However when I
attempt to extract the zip file again using the classes in
it fails. There is no exception thrown, instead the method getEntries() returns
a value of 0, indicating that this is a completely empty zip file.

If you modify this line of code in my ZipUtils class, it will start working:


final ZipOutputStream jos = new ZipOutputStream( new BufferedOutputStream( new
FileOutputStream( outfile ) ) );


final ZipOutputStream jos = new ZipOutputStream( outfile );

The subsequent line causes the ZipOutputStream to use a RandomAccessFile when
making the zip file. I would prefer to use the RandomAccessFile because it does
not result in the creation of extra Data Descriptor chunks that waste space. I
don't know if the problem is with the compression or the extraction, but my
guess is the extraction since I can open the created zip file in many native

I have attached my code to this bug.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message