Commit 7b540482 by Mark Wielaard Committed by Mark Wielaard

ZipEntry.java (ZipEntry(String)): When name is bigger then 65535 chars throw…

ZipEntry.java (ZipEntry(String)): When name is bigger then 65535 chars throw IllegalArgumentException.

       * java/util/zip/ZipEntry.java (ZipEntry(String)): When name is bigger
       then 65535 chars throw IllegalArgumentException.

From-SVN: r63222
parent fefabda5
2003-02-21 Mark Wielaard <mark@klomp.org> 2003-02-21 Mark Wielaard <mark@klomp.org>
* java/util/zip/ZipEntry.java (ZipEntry(String)): When name is bigger
then 65535 chars throw IllegalArgumentException.
2003-02-21 Mark Wielaard <mark@klomp.org>
* java/util/zip/ZipFile.java (finalize): New method. * java/util/zip/ZipFile.java (finalize): New method.
2003-02-21 Michael Koch <konqueror@gmx.de> 2003-02-21 Michael Koch <konqueror@gmx.de>
......
...@@ -84,11 +84,15 @@ public class ZipEntry implements ZipConstants, Cloneable ...@@ -84,11 +84,15 @@ public class ZipEntry implements ZipConstants, Cloneable
* Creates a zip entry with the given name. * Creates a zip entry with the given name.
* @param name the name. May include directory components separated * @param name the name. May include directory components separated
* by '/'. * by '/'.
*
* @exception NullPointerException when name is null.
* @exception IllegalArgumentException when name is bigger then 65535 chars.
*/ */
public ZipEntry(String name) public ZipEntry(String name)
{ {
if (name == null) int length = name.length();
throw new NullPointerException(); if (length > 65535)
throw new IllegalArgumentException("name length is " + length);
this.name = name; this.name = name;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment