Why does the new File(URI) constructor restricts the uri to hierarchical?

Alan Bateman Alan.Bateman at oracle.com
Mon May 16 03:45:44 PDT 2011


Michael McMahon wrote:
> Paulo,
>
> URI's with a scheme (such as file:) cannot be relative. That's a 
> feature of
> the specification of URIs themselves. So, this behavior is a 
> side-effect of the
> requirement that the URI provided to the constructor has a file: scheme.
Right, and I suspect the relative URIs that he has may actually be 
relative to a http URI rather than a file URI. If they are relative to a 
file URI then the question is what is the base. If the working directory 
then he can use new File("").toURI() as the base but it could be 
somewhere else.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20110516/04615643/attachment.html 


More information about the net-dev mailing list