aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/util
diff options
context:
space:
mode:
authorKresten Krab Thorup <krab@gnu.org>1999-08-18 14:16:42 +0000
committerKresten Krab Thorup <krab@gcc.gnu.org>1999-08-18 14:16:42 +0000
commiteb4534a63677aa47ec9e5cc460617622b905d736 (patch)
tree3bcaf8f2877d654d67d3e2cc982a85a71299ca35 /libjava/java/util
parent312f625598f2eed11718c43a649027bc760ef30a (diff)
downloadgcc-eb4534a63677aa47ec9e5cc460617622b905d736.zip
gcc-eb4534a63677aa47ec9e5cc460617622b905d736.tar.gz
gcc-eb4534a63677aa47ec9e5cc460617622b905d736.tar.bz2
natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed from _Jv_InternClassStrings.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed from _Jv_InternClassStrings. * prims.cc (_Jv_RunMain): New function. (JvRunMain): Remove gij-support. * gij.cc (main): Use _Jv_RunMain. * java/util/zip/ZipFile.java: Call readDirectory in constructor. * interpret.cc (PUSHA, PUSHI, PUSHF, PUSHL, PUSHD): Don't store argument in temp variable. (continue1): For all op_x2y insns, use temp variable for intermediate value. Also remove some comments. * java/lang/natClass.cc (newInstance): Call _Jv_InitClass. (forName): Don't call _Jv_InitClass. * java/lang/Class.java (getResource,getResourceAsStream): Implement. * java/util/zip/ZipEntry.java (ZipEntry(ZipEntry)): New construcor. * java/util/jar/JarInputStream.java: New file. * java/util/jar/JarEntry.java: New file. * java/util/jar/JarFile.java: New file. * java/net/URLClassLoader.java: New file. * java/net/JarURLConnection.java: New file. * gnu/gcj/protocol/jar/Handler.java: New file. * gnu/gcj/protocol/jar/Connection.java: New file. * java/security/SecureClassLoader.java: New file. * java/lang/ClassLoader.java (parent): New variable. (ClassLoader (ClassLoader)): new constructor. (findClass): New method. (loadClass): Add default 1.2 implementation. (getSystemResourceAsBytes, getResourceAsBytes): Removed. (readfully): Removed. * gnu/gcj/runtime/VMClassLoader.java: Moved from java/lang. (findSystemClass): New method. (VMClassLoader): Constructor rewritten. (init): New method. All other methods removed. * java/lang/natClassLoader.cc: Change use of java::lang::VMClassLoader to gnu::gcj::runtime::VMClassLoader. (_Jv_InternClassStrings): Use _Jv_ResolvePoolEntry. Also handle class entries. (VMClassLoader::findSystemClass): renamed from findBootClass. * Makefile.am: Add new files. (FirstThread.h, ThreadGroup.h): Add _Jv_Main friend. * Makefile.in: Rebuilt. From-SVN: r28748
Diffstat (limited to 'libjava/java/util')
-rw-r--r--libjava/java/util/jar/JarEntry.java39
-rw-r--r--libjava/java/util/jar/JarFile.java56
-rw-r--r--libjava/java/util/jar/JarInputStream.java32
-rw-r--r--libjava/java/util/zip/ZipEntry.java12
-rw-r--r--libjava/java/util/zip/ZipFile.java2
5 files changed, 141 insertions, 0 deletions
diff --git a/libjava/java/util/jar/JarEntry.java b/libjava/java/util/jar/JarEntry.java
new file mode 100644
index 0000000..0fe202b
--- /dev/null
+++ b/libjava/java/util/jar/JarEntry.java
@@ -0,0 +1,39 @@
+/* Copyright (C) 1999 Cygnus Solutions
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+package java.util.jar;
+
+import java.util.zip.*;
+
+/**
+ * Does not implement the security and manifest methods.
+ *
+ * @author Kresten Krab Thorup <krab@gnu.org>
+ * @date August 10, 1999.
+ */
+
+public class JarEntry extends ZipEntry
+{
+ ZipEntry zip;
+
+ public JarEntry (ZipEntry ent)
+ {
+ super (ent);
+ }
+
+ public JarEntry (JarEntry ent)
+ {
+ super (ent);
+ }
+
+ public JarEntry (String name)
+ {
+ super (name);
+ }
+
+}
diff --git a/libjava/java/util/jar/JarFile.java b/libjava/java/util/jar/JarFile.java
new file mode 100644
index 0000000..efab3c2
--- /dev/null
+++ b/libjava/java/util/jar/JarFile.java
@@ -0,0 +1,56 @@
+/* Copyright (C) 1999 Cygnus Solutions
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+package java.util.jar;
+
+import java.util.zip.*;
+import java.io.File;
+
+/**
+ * Does not implement any of the security. Just a place holder, so
+ * that I can implement URLClassLoader.
+ *
+ * @author Kresten Krab Thorup <krab@gnu.org>
+ * @date August 10, 1999.
+ */
+
+public class JarFile extends ZipFile
+{
+ private boolean verify;
+
+ public JarFile (String file) throws java.io.IOException
+ {
+ super (file);
+ }
+
+ public JarFile (File file) throws java.io.IOException
+ {
+ super (file);
+ }
+
+ public JarFile (String file, boolean verify) throws java.io.IOException
+ {
+ super (file);
+ this.verify = verify;
+ }
+
+ public JarFile (File file, boolean verify) throws java.io.IOException
+ {
+ super (file);
+ this.verify = verify;
+ }
+
+ public JarEntry getJarEntry (String name)
+ {
+ ZipEntry ent = getEntry(name);
+ if (ent == null)
+ return null;
+ else
+ return new JarEntry(ent);
+ }
+}
diff --git a/libjava/java/util/jar/JarInputStream.java b/libjava/java/util/jar/JarInputStream.java
new file mode 100644
index 0000000..476e75f
--- /dev/null
+++ b/libjava/java/util/jar/JarInputStream.java
@@ -0,0 +1,32 @@
+/* Copyright (C) 1999 Cygnus Solutions
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+package java.util.jar;
+
+import java.util.zip.*;
+
+/**
+ * Does not implement any of the security. Just a place holder, so
+ * that I can implement URLClassLoader.
+ *
+ * @author Kresten Krab Thorup <krab@gnu.org>
+ * @date August 10, 1999.
+ */
+
+public class JarInputStream extends ZipInputStream
+{
+ public JarEntry getNextJarEntry () throws java.io.IOException
+ {
+ return new JarEntry (getNextEntry ());
+ }
+
+ public JarInputStream (java.io.InputStream is)
+ {
+ super(is);
+ }
+}
diff --git a/libjava/java/util/zip/ZipEntry.java b/libjava/java/util/zip/ZipEntry.java
index 9bd3c41..915c4b2 100644
--- a/libjava/java/util/zip/ZipEntry.java
+++ b/libjava/java/util/zip/ZipEntry.java
@@ -46,6 +46,18 @@ public class ZipEntry implements ZipConstants
this.name = name;
}
+ public ZipEntry (ZipEntry ent)
+ {
+ comment = ent.comment;
+ compressedSize = ent.compressedSize;
+ crc = ent.crc;
+ extra = ent.extra;
+ method = ent.method;
+ size = ent.size;
+ time = ent.time;
+ relativeOffset = ent.relativeOffset;
+ }
+
public String getComment () { return comment; }
public long getCompressedSize () { return compressedSize; }
diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java
index bfb077d..1b0ebce 100644
--- a/libjava/java/util/zip/ZipFile.java
+++ b/libjava/java/util/zip/ZipFile.java
@@ -22,12 +22,14 @@ public class ZipFile implements ZipConstants
{
file = new RandomAccessFile(fname, "r");
name = fname;
+ readDirectory ();
}
public ZipFile (File f) throws IOException
{
file = new RandomAccessFile(f, "r");
name = f.getName();
+ readDirectory ();
}
void readDirectory () throws IOException