This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug] ZipFile.entries() returns null for bad zip-file


Hi Tom,

Tom Tromey wrote:
Nevertheless, invoking "ZipFile.entries()" on a
ZipFile-instance representing a corrupt zip-file (any file
not being a valid zip-file), returns null, whereas I would
expect an empty enumeration instead...

I tried the test program with svn head and I get:


opsy. gij Provoke Exception in thread "main"
java.util.zip.ZipException: Not a valid zip file at
java.util.zip.ZipFile.checkZipFile(ZipFile.java:197) at
java.util.zip.ZipFile.<init>(ZipFile.java:136) at
Provoke.main(Provoke.java:8)

This seems more reasonable offhand, but in cases like this I ordinarily would test against the JDK as well (however I don't have
it installed atm...)

Thanks! That's the same behaviour as JDK - failing on the opening of the file!


So, just ignore me ;-)

// Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]