diff options
Diffstat (limited to 'libjava/java/net')
-rw-r--r-- | libjava/java/net/URLStreamHandler.java | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java index 2e91eb6..fbe863f 100644 --- a/libjava/java/net/URLStreamHandler.java +++ b/libjava/java/net/URLStreamHandler.java @@ -214,23 +214,9 @@ public abstract class URLStreamHandler file = (file.substring(0, lastSlash) + '/' + spec.substring(start, end)); - if (url.getProtocol().equals("file")) - { - // For "file" URLs constructed relative to a context, we - // need to canonicalise the file path. - try - { - boolean endsWithSlash = file.charAt(file.length() - 1) == '/'; - file = new File(file).getCanonicalPath(); - file = file.replace(separator, '/'); - if (endsWithSlash && file.charAt(file.length() - 1) != '/') - file += '/'; - } - catch (IOException e) - { - // Do nothing. - } - } + // For URLs constructed relative to a context, we + // need to canonicalise the file path. + file = canonicalizeFilename(file); ref = null; } |