[ 
https://issues.apache.org/jira/browse/COMPRESS-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Antoni Mylka updated COMPRESS-62:
---------------------------------

    Attachment: zip-problem.zip

Since this issue is about test files I hope I won't be too much out of place to 
attach my file here.

One of the zip files from the Test Suite of the Aperture project is read 
incorrectly by the ZipArchiveInputStream, though it does work OK with 
java.util.zip. 

It can be downloaded here:

https://aperture.svn.sourceforge.net/svnroot/aperture/aperture/trunk/test/docs/src/main/resources/org/semanticdesktop/aperture/docs/zip-problem.zip

I also attach it for your convenience.

It seems that some files in this zip contain copyright headers which make it 
impossible for me to grant the license to ASF. But I hope you can work out 
what's wrong.

What I do is read this file with a following code:

public class Crap2 {
        public static void main(String [] args) throws Exception {
                File file = new File("/home/antheque/zip-problem.zip");
                InputStream stream = new FileInputStream(file);
                ZipArchiveInputStream st = new ZipArchiveInputStream(stream);
                ZipArchiveEntry entry = null;
                while ((entry = st.getNextZipEntry()) != null) {
                        System.out.println(entry.getName());
                }
        }
}

and then I get this exception:

Exception in thread "main" java.lang.RuntimeException: data starting at 0 is in 
unknown format
        at 
org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setExtra(ZipArchiveEntry.java:283)
        at 
org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextZipEntry(ZipArchiveInputStream.java:179)
        at crap.Crap2.main(Crap2.java:17)
Caused by: java.util.zip.ZipException: data starting at 0 is in unknown format
        at 
org.apache.commons.compress.archivers.zip.ExtraFieldUtils.parse(ExtraFieldUtils.java:115)
        at 
org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setExtra(ZipArchiveEntry.java:280)
        ... 2 more

I use the 1.0 release

> Need many more test cases to check that can read "real" archives
> ----------------------------------------------------------------
>
>                 Key: COMPRESS-62
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-62
>             Project: Commons Compress
>          Issue Type: Improvement
>            Reporter: Sebb
>         Attachments: zip-problem.zip
>
>
> There are very few test input files, and not all of them seem to be used.
> It would be useful to build up a library of test cases, with expected 
> results, e.g. the file names expected in each archive.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to