summaryrefslogtreecommitdiffstats
path: root/libjava/java/net/JarURLConnection.java
diff options
context:
space:
mode:
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-09 00:04:00 +0000
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-09 00:04:00 +0000
commit7a8b6aa6ff1178434f8b82b829b9a62d13650aa5 (patch)
tree6e19dd042b0e115509080d56c741014c959ca437 /libjava/java/net/JarURLConnection.java
parentf3782e9bd70c6eae9d91d261c091686ac4dc8c0b (diff)
downloadppe42-gcc-7a8b6aa6ff1178434f8b82b829b9a62d13650aa5.tar.gz
ppe42-gcc-7a8b6aa6ff1178434f8b82b829b9a62d13650aa5.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59949 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/net/JarURLConnection.java')
-rw-r--r--libjava/java/net/JarURLConnection.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/libjava/java/net/JarURLConnection.java b/libjava/java/net/JarURLConnection.java
index a90c7f33037..6f4cd1fe7ea 100644
--- a/libjava/java/net/JarURLConnection.java
+++ b/libjava/java/net/JarURLConnection.java
@@ -134,7 +134,11 @@ public abstract class JarURLConnection extends URLConnection
if (jarfile != null)
{
// this is the easy way...
- return jarfile.getInputStream (jarfile.getEntry (element));
+ ZipEntry entry = jarfile.getEntry(element);
+ if (entry != null)
+ return jarfile.getInputStream (entry);
+ else
+ return null;
}
else
{
@@ -320,12 +324,17 @@ public abstract class JarURLConnection extends URLConnection
// to add others later and for consistency, we'll implement it this way.
// Add the only header we know about right now: Content-length.
- long len;
+ long len = -1;
if (element == null)
- len = jarFileURLConnection.getContentLength ();
+ if (jarFileURLConnection != null)
+ len = jarFileURLConnection.getContentLength ();
else
- len = getJarEntry ().getSize ();
+ {
+ JarEntry entry = getJarEntry();
+ if (entry != null)
+ len = entry.getSize ();
+ }
String line = "Content-length: " + len;
hdrVec.addElement(line);
@@ -381,7 +390,6 @@ public abstract class JarURLConnection extends URLConnection
{
JarFile file = getJarFile ();
- // FIXME: implement this
- return null;
+ return (file != null) ? file.getManifest() : null;
}
}
OpenPOWER on IntegriCloud