summaryrefslogtreecommitdiff
path: root/java/net
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2005-11-17 10:58:46 +0000
committerMark Wielaard <mark@klomp.org>2005-11-17 10:58:46 +0000
commit5dd12d0fd420911109c6a98bba8c7f77c63fa36e (patch)
tree08c0f9416e0640b54ea388128cdfb32faaa80685 /java/net
parent2eaf96bab3bae3b4c07103cfbf7bfbf75c6e42b2 (diff)
downloadclasspath-5dd12d0fd420911109c6a98bba8c7f77c63fa36e.tar.gz
2005-11-17 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 (get): Likewise. * java/net/URL.java (URL): If the file part of a spec is absolute, ignore the file part of its context.
Diffstat (limited to 'java/net')
-rw-r--r--java/net/URL.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/java/net/URL.java b/java/net/URL.java
index 627dbc391..1d947a0b4 100644
--- a/java/net/URL.java
+++ b/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.