On Jul 11, 2008, at 13:22, Jeremias Maerki wrote:

Bonekrusher and I had an exchange off-list. He did a few tests for me
and my recent change didn't help either.

Basically, we established the following:
- He's also running WinXP
- He's running the same JDK as I do.

The /exact/ same one (identical build)?

Just asking, since I remember running across some issues/ inconsistencies in the way the java.net.URL and java.net.URI translate themselves to a String. Maybe that's what's playing here... Is the warning about the deprecated File.toURL() maybe related and a hint?

As of Java 6, the recommended way is to use File.toURI().toURL(). According to the API docs, File.toURL() "does not automatically escape characters that are illegal in URLs. It is recommended that new code convert an abstract pathname into a URL by first converting it into a URI, via the toURI method, and then converting the URI into a URL via the URI.toURL method."

Makes you wonder why the implementation of toURL() then does not simply do that already... I assume this is for reasons of backward- compatibility, so as to not break any existing code that relies on that behavior (?)



Cheers

Andreas

Reply via email to