diff options
author | Andrew Haley <aph@redhat.com> | 2005-07-14 18:20:10 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2005-07-14 18:20:10 +0000 |
commit | 3fefd0193cc8dcd50fe626a9d81719ba3c845a2f (patch) | |
tree | 8de981c27b99e5f3550c9d6ebf969b8edaec99fa /libjava/java/net/URL.java | |
parent | b11e14262e1381cc7e7322aec4d5be27bb15529b (diff) | |
download | gcc-3fefd0193cc8dcd50fe626a9d81719ba3c845a2f.zip gcc-3fefd0193cc8dcd50fe626a9d81719ba3c845a2f.tar.gz gcc-3fefd0193cc8dcd50fe626a9d81719ba3c845a2f.tar.bz2 |
Connection.java (unquote): New method.
2005-07-13 Andrew Haley <aph@redhat.com>
* gnu/java/net/protocol/file/Connection.java (unquote): New
method.
(connect): Unquote filename.
gnu/java/net/protocol/jar/Connection.java (getInputStream):
Likewise.
(getJarFile): Likewise.
* java/net/URLConnection.java (getContentHandler): Guard cast with
instaceof.
* java/net/URL.java (URL): If the file part of a spec is absolute,
ignore the file part of its context.
From-SVN: r102029
Diffstat (limited to 'libjava/java/net/URL.java')
-rw-r--r-- | libjava/java/net/URL.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java index a136556..0ae7c1c 100644 --- a/libjava/java/net/URL.java +++ b/libjava/java/net/URL.java @@ -408,10 +408,7 @@ public final class URL implements Serializable // The 1.2 doc specifically says these are copied to the new URL. host = context.host; port = context.port; - file = context.file; userInfo = context.userInfo; - if (file == null || file.length() == 0) - file = "/"; authority = context.authority; } } @@ -423,10 +420,13 @@ public final class URL implements Serializable protocol = context.protocol; host = context.host; port = context.port; - file = context.file; userInfo = context.userInfo; - if (file == null || file.length() == 0) - file = "/"; + if (spec.indexOf(":/", 1) < 0) + { + file = context.file; + if (file == null || file.length() == 0) + file = "/"; + } authority = context.authority; } else // Protocol NOT specified in spec. and no context available. |