ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: svn commit: r1554758 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/AntClassLoader.java src/tests/antunit/taskdefs/optional/junit/junit-test.xml src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
Date Thu, 02 Jan 2014 15:34:10 GMT
On 2014-01-02, Jesse Glick wrote:

> On Thu, Jan 2, 2014 at 2:22 AM,  <bodewig@apache.org> wrote:
>+                        try {
>+                            jarFile = new JarFile(file);
>+                        } catch (ZipException notAJar) {
>+                            // raised if a file that is not a ZIP

> Would also be thrown if the file _is_ a ZIP file but there was some
> (potentially significant) error opening it.

Right.

> Could consider checking the file header for the magic sequence {0x50,
> 0x4b, 0x03, 0x04} and rethrowing the exception. (Have observed {0x50,
> 0x4b, 0x05, 0x06} in empty archives as well,

or PK00.  I know, I spent some time with the format :-)

You are right, of course, will port over ZipArchiveInputStream#matches
from Commons Compress.

Stefan

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


Mime
View raw message