[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: fixed URLStreamHandler's file path canonicalisation

Kaffe CVS cvs-commits at kaffe.org
Wed Nov 10 18:14:10 PST 2004


PatchSet 5441 
Date: 2004/11/11 02:09:45
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: fixed URLStreamHandler's file path canonicalisation

2004-11-11  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/net/URLStreamHandler.java:
        Resynced with GNU Classpath.

        2004-11-08  Jeroen Frijters  <jeroen at frijters.net>

        * java/net/URLStreamHandler.java
        (parseURL): Fixed file path canonicalisation.

Members: 
	ChangeLog:1.2988->1.2989 
	libraries/javalib/java/net/URLStreamHandler.java:1.20->1.21 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2988 kaffe/ChangeLog:1.2989
--- kaffe/ChangeLog:1.2988	Thu Nov 11 01:56:24 2004
+++ kaffe/ChangeLog	Thu Nov 11 02:09:45 2004
@@ -1,5 +1,15 @@
 2004-11-11  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/net/URLStreamHandler.java:
+        Resynced with GNU Classpath.
+
+	2004-11-08  Jeroen Frijters  <jeroen at frijters.net>
+
+        * java/net/URLStreamHandler.java
+        (parseURL): Fixed file path canonicalisation.
+
+2004-11-11  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/io/File.java,
 	libraries/javalib/java/io/VMFile.java:
         Resynced with GNU Classpath.
Index: kaffe/libraries/javalib/java/net/URLStreamHandler.java
diff -u kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.20 kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.21
--- kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.20	Sat Oct 16 13:31:00 2004
+++ kaffe/libraries/javalib/java/net/URLStreamHandler.java	Thu Nov 11 02:09:46 2004
@@ -214,23 +214,9 @@
 	  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;
       }




More information about the kaffe mailing list