Patch: FYI: fix File.toURL bug
Tom Tromey
tromey@redhat.com
Tue Sep 11 21:28:00 GMT 2001
I'm checking this in. File.toURL didn't comply with the spec. This
patch fixes it.
URL still transforms the URL from `file:///tmp/foo' to `file:/tmp/foo'.
That's too bad (my reading of the URL RFC is that the former is correct).
I'm not planning to look into that.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/io/File.java (toURL): Use getAbsolutePath and `file://'.
Index: java/io/File.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/File.java,v
retrieving revision 1.20
diff -u -r1.20 File.java
--- java/io/File.java 2001/08/31 22:31:40 1.20
+++ java/io/File.java 2001/09/12 04:27:04
@@ -281,7 +281,8 @@
public URL toURL () throws MalformedURLException
{
- return new URL ("file:" + path + (isDirectory() ? "/" : ""));
+ return new URL ("file://" + getAbsolutePath ()
+ + (isDirectory() ? "/" : ""));
}
private final native boolean performMkdir ();
More information about the Java-patches
mailing list