From e825ca7ff5b76e07bdcecd4e02fc3e5df792ea72 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 9 Dec 2002 00:04:00 +0000 Subject: Connection.java (getJarFile): download and cache remote jar files. * gnu/gcj/protocol/jar/Connection.java (getJarFile): download and cache remote jar files. * gnu/gcj/runtime/VMClassLoader.java: Don't construct jar URL, only add File.separator to URL when it is a directory. * java/lang/ClassLoader.java: Add Classpath javadoc. (parent): final. (getParent): Add (disabled) security check. (findLibrary): New default method. * java/net/JarURLConnection.java (getManifest): Implement. (getInputStream): Only create InputStream when entry exists. (getHeaders): Only use jarFileURLConnection or JarEntry to set length when they exist. * java/net/URLClassLoader.java: New/Rewritten version from Classpath. From-SVN: r59949 --- libjava/gnu/gcj/runtime/VMClassLoader.java | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'libjava/gnu/gcj/runtime/VMClassLoader.java') diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java index 77d21606621..fd0c32c2c57 100644 --- a/libjava/gnu/gcj/runtime/VMClassLoader.java +++ b/libjava/gnu/gcj/runtime/VMClassLoader.java @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001 Free Software Foundation +/* Copyright (C) 1999, 2001, 2002 Free Software Foundation This file is part of libgcj. @@ -33,23 +33,10 @@ public final class VMClassLoader extends java.net.URLClassLoader String e = st.nextToken (); try { - if (e.endsWith(".jar") || e.endsWith (".zip")) - { - File archive = new File (e); - try { - p.addElement(new URL("jar", "", -1, "file://" - + archive.getCanonicalPath () - + "!/")); - } catch (IOException ex) { - // empty - } - } - else if (e.endsWith ("/")) - p.addElement (new URL("file", "", -1, e)); - else if (new File (e).isDirectory ()) - p.addElement (new URL("file", "", -1, e + "/")); + if (!e.endsWith (File.separator) && new File (e).isDirectory ()) + p.addElement (new URL("file", "", -1, e + File.separator)); else - /* Ignore path element. */; + p.addElement (new URL("file", "", -1, e)); } catch (java.net.MalformedURLException x) { -- cgit v1.2.3