ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <typr...@gmail.com>
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:10:40 GMT
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. 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, so maybe just check for {0x50, 0x4b} i.e.
"PK".)

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


Mime
View raw message