* File.toURL() problem
@ 2001-09-10 22:37 Anthony Green
2001-09-11 17:22 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Anthony Green @ 2001-09-10 22:37 UTC (permalink / raw)
To: java; +Cc: rhug-rhats
One of the few local changes I had to make to Xalan is related to File.toURL().
xsltc contains
(new File(stylesheetName)).toURL()
which for the JDK returns "file:myname", but for gcj returns "file:/myname".
I worked around this problem in xsltc by using the following instead:
new URL("file", "", -1, stylesheetName)
...which appears to give the desired behaviour.
AG
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: File.toURL() problem
2001-09-10 22:37 File.toURL() problem Anthony Green
@ 2001-09-11 17:22 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2001-09-11 17:22 UTC (permalink / raw)
To: green; +Cc: java, rhug-rhats
>>>>> "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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-11 17:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-10 22:37 File.toURL() problem Anthony Green
2001-09-11 17:22 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).