OSDN Git Service

* java/io/File.java (toURL): Use getAbsolutePath and `file://'.
[pf3gnuchains/gcc-fork.git] / libjava / java / io / File.java
index 12297ac..3ecd7bf 100644 (file)
@@ -281,7 +281,8 @@ public class File implements Serializable, Comparable
 
   public URL toURL () throws MalformedURLException
   {
-    return new URL ("file:" + path + (isDirectory() ? "/" : ""));
+    return new URL ("file://" + getAbsolutePath ()
+                   + (isDirectory() ? "/" : ""));
   }
 
   private final native boolean performMkdir ();