The spec for File.toUri contains the following:
>> For a given abstract pathname f, it is guaranteed that
>> new File( f.toURI()).equals( f.getAbsoluteFile())
On Windows, the result of f.toUri() is something like
When I try and use new File(f.toUri()) I get the following exception
java.lang.IllegalArgumentException: URI has an authority component
This is with JDK 1.7, on Windows XP SP2, using Cygwin.
How do you get that URI? From what file?
In my Windows, jrunscript shows:
js> new File("c:\\temp\\x").toURI()
This appears to be a bug in javax.tools.JavaFileObject.toUri() rather than java.io.File. The toUri method is returning a URI with the drive letter in the authority component.