File.toURL() problem

Tom Tromey tromey@redhat.com
Tue Sep 11 17:22:00 GMT 2001


>>>>> "Anthony" == Anthony Green <green@redhat.com> writes:

Anthony> xsltc contains 
Anthony>       (new File(stylesheetName)).toURL()
Anthony> which for the JDK returns "file:myname", but for gcj returns
Anthony> "file:/myname".

The online docs say the return value is system-dependent.
However I think they mean OS-dependent and not VM implementation.

My JDK 1.2 installation returns `file:/tmp/myname' (when run in /tmp).
Classpath looks like it would return `file:///tmp/myname'.

Sigh.  `file:' URLs suck, since everybody gets confused about leading
`/'s.

Anyway, I agree we have a bug.  The URL we return is clearly not
correct.  I've added this to my (stunningly long) to-do list.

Tom



More information about the Java mailing list