From: Jeroen Frijters Date: Thu, 18 Nov 2004 20:24:33 +0000 (+0000) Subject: 2004-11-18 Jeroen Frijters X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6e5b508490a8a67f277e965dd0e2ae3b073d3c9b;p=gcc.git 2004-11-18 Jeroen Frijters * java/net/URLStreamHandler.java (parseURL): Fixed file path canonicalisation. From-SVN: r90880 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d565ec04203..6aeddd60733 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -3,6 +3,11 @@ * java/net/URLStreamHandler.java (parseURL): Fixed file path canonicalisation. +2004-11-18 Jeroen Frijters + + * java/net/URLStreamHandler.java + (parseURL): Fixed file path canonicalisation. + 2004-11-18 Michael Koch * java/net/URLClassLoader.java: Whitespace cleanup. diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java index 2e91eb64014..fbe863f24c0 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; }