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:22:10 GMT
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.

The expected signature right now is

"local file header marker" - four bytes
"version needed to extract" - two bytes
"general purpose flag" - two bytes

you really only can rely on the LFH-signature since "version needed to
extract" will be different for many archivers, as will be the general
purpose bits.

I'll reduce the sugnature check to the LFH.

Note that the method (or better the input stream) is still broken in a
more general sense since it will not detect self extracting ZIP files
which do have a tiny native bootstrapper tacked to the front of the
archive.  The ZipFile class can read them, ZipArchiveInputStream
can't.

Stefan

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


Mime
View raw message