1 Clazz.declarePackage ("java.util.zip");
2 Clazz.load (["java.util.zip.ZipConstants"], "java.util.zip.ZipEntry", ["java.lang.IllegalArgumentException", "$.InternalError", "$.NullPointerException", "java.util.Date"], function () {
3 c$ = Clazz.decorateAsClass (function () {
14 Clazz.instantialize (this, arguments);
15 }, java.util.zip, "ZipEntry", null, [java.util.zip.ZipConstants, Cloneable]);
16 Clazz.makeConstructor (c$,
19 throw new NullPointerException ();
20 }if (name.length > 0xFFFF) {
21 throw new IllegalArgumentException ("entry name too long");
24 Clazz.defineMethod (c$, "getName",
28 Clazz.defineMethod (c$, "setTime",
30 this.time = java.util.zip.ZipEntry.javaToDosTime (time);
32 Clazz.defineMethod (c$, "getTime",
34 return this.time != -1 ? java.util.zip.ZipEntry.dosToJavaTime (this.time) : -1;
36 Clazz.defineMethod (c$, "setSize",
39 throw new IllegalArgumentException ("invalid entry size");
42 Clazz.defineMethod (c$, "getSize",
46 Clazz.defineMethod (c$, "getCompressedSize",
50 Clazz.defineMethod (c$, "setCompressedSize",
54 Clazz.defineMethod (c$, "setCrc",
56 if (crc < 0 || crc > 0xFFFFFFFF) {
57 throw new IllegalArgumentException ("invalid entry crc-32");
60 Clazz.defineMethod (c$, "getCrc",
64 Clazz.defineMethod (c$, "setMethod",
66 if (method != 0 && method != 8) {
67 throw new IllegalArgumentException ("invalid compression method");
68 }this.method = method;
70 Clazz.defineMethod (c$, "getMethod",
74 Clazz.defineMethod (c$, "setExtra",
76 if (extra != null && extra.length > 0xFFFF) {
77 throw new IllegalArgumentException ("invalid extra field length");
80 Clazz.defineMethod (c$, "getExtra",
84 Clazz.defineMethod (c$, "setComment",
86 this.comment = comment;
88 Clazz.defineMethod (c$, "getComment",
92 Clazz.defineMethod (c$, "isDirectory",
94 return this.name.endsWith ("/");
96 Clazz.overrideMethod (c$, "toString",
98 return this.getName ();
100 c$.dosToJavaTime = Clazz.defineMethod (c$, "dosToJavaTime",
102 var d = new java.util.Date ((((dtime >> 25) & 0x7f) + 80), (((dtime >> 21) & 0x0f) - 1), ((dtime >> 16) & 0x1f), ((dtime >> 11) & 0x1f), ((dtime >> 5) & 0x3f), ((dtime << 1) & 0x3e));
105 c$.javaToDosTime = Clazz.defineMethod (c$, "javaToDosTime",
107 var d = new java.util.Date (time);
108 var year = d.getYear () + 1900;
111 }return (year - 1980) << 25 | (d.getMonth () + 1) << 21 | d.getDate () << 16 | d.getHours () << 11 | d.getMinutes () << 5 | d.getSeconds () >> 1;
113 Clazz.overrideMethod (c$, "hashCode",
115 return this.name.hashCode ();
117 Clazz.defineMethod (c$, "clone",
120 var e = Clazz.superCall (this, java.util.zip.ZipEntry, "clone", []);
121 if (this.extra != null) {
122 e.extra = Clazz.newByteArray (this.extra.length, 0);
123 System.arraycopy (this.extra, 0, e.extra, 0, this.extra.length);
126 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
127 throw new InternalError ();
133 Clazz.defineStatics (c$,