commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: [compress] Archiver Detection fails
Date Thu, 26 Feb 2009 09:41:52 GMT
On 2009-02-26, Stefan Bodewig <bodewig@apache.org> wrote:

> On 2009-02-26, Christian Grobmeier <grobmeier@gmail.com> wrote:

>> I recently figured out that a compress created zip file doesn't
>> necessary match the signature of
>> ZipArchiveInputStream.matches(...)

> This is because the method is wrong - will be "fixed" in a few
> minutes, see below.

Note that JarArchiveInputStream.matches was just as wrong but with the
added twist that it expected the general purpose bit 3 to be on (while
zip expected it to be off).

What this really means is "if the bit is set, I'm using the DEFLATED
method and store the length inside the data descriptor" - something
that is completely irrelevant to the question of whether it is a jar
or a zip file.

Given that jars are zips, you can't really autodetect jars and the new
code reflects this - I had to change the unit test which assumed one
could.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message