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