« Return to Thread: Common Bugs

Re: Common Bugs

by Benjamin Bentmann :: Rate this Message:

Reply to Author | View in Thread

>  new File( new URI( url.toString() ) )

Correction:
JRE 1.4 is happily returning invalid/unescaped URLs from
ClassLoader.getResource(), making the above suggestion fail with a
URISyntaxException.

The new suggestion is to use FileUtils.toFile(URL) [0] from Commons IO. A
similar methods exists in Plexus Utils but it's currently not decoding
escape sequences.


Benjamin


[0]
http://commons.apache.org/io/api-release/org/apache/commons/io/FileUtils.html#toFile(java.net.URL)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

 « Return to Thread: Common Bugs