commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Michaelchuck (Created) (JIRA)" <>
Subject [jira] [Created] (COMPRESS-159) ChangeSetPerformer not reliable for ZipArchiveInputStreams
Date Tue, 27 Sep 2011 18:19:45 GMT
ChangeSetPerformer not reliable for ZipArchiveInputStreams

                 Key: COMPRESS-159
             Project: Commons Compress
          Issue Type: Bug
          Components: Changesets
    Affects Versions: 1.2
         Environment: OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-4)
OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode)
Linux 2.6.38-1-amd64 #1 SMP Wed Mar 16 17:38:02 UTC 2011 x86_64 GNU/Linux

            Reporter: Jon Michaelchuck

ChangeSetPerformer's perform function takes an ArchiveInputStream as an argument and thus
frequently runs into issues described under heading 'ZipArchiveInputStream vs ZipFile' at 

Personally for a simple local solution I've added a slightly modified performZip function
taking a ZipFile argument in place of the ArchiveInputStream argument:

diff perform performZip
<     public ChangeSetResults perform(ArchiveInputStream in, ArchiveOutputStream out)
>     public ChangeSetResults performZip(ZipFile zf, ArchiveOutputStream out)
<         ArchiveEntry entry = null;
<         while ((entry = in.getNextEntry()) != null) {
>         ArrayList<ZipArchiveEntry> entries = Collections.list(zf.getEntriesInPhysicalOrder());
>         for (ZipArchiveEntry entry : entries) {
<                 copyStream(in, out, entry);
>                 copyStream(zf.getInputStream(entry), out, entry);

A permanent fix may require some re-design, the perform(ArchiveInputStream in, ArchiveOutputStream
out) abstraction may be overly general.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message