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
This commit is contained in:
Mark Wielaard 2003-02-21 14:08:40 +00:00 committed by Mark Wielaard
parent fefabda543
commit 7b54048202
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
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.

View File

@ -84,11 +84,15 @@ public class ZipEntry implements ZipConstants, Cloneable
* Creates a zip entry with the given name.
* @param name the name. May include directory components separated
* by '/'.
*
* @exception NullPointerException when name is null.
* @exception IllegalArgumentException when name is bigger then 65535 chars.
*/
public ZipEntry(String name)
{
if (name == null)
throw new NullPointerException();
int length = name.length();
if (length > 65535)
throw new IllegalArgumentException("name length is " + length);
this.name = name;
}