Why does the new File(URI) constructor restricts the uri to hierarchical?
Paulo Levi
i30817 at gmail.com
Sat May 14 10:24:35 PDT 2011
I have a mapping from uri to real files, and to i was hoping to use that
constructor to do the work, however it says it only accepts,
"absolute, hierarchical URI with a scheme equal to "file""
Now, many times on html files the uri would be the second notion of
hierarchical from the javadoc
"A *hierarchical* URI is either an absolute URI whose scheme-specific part
begins with a slash character, *or a relative URI, that is, a URI that does
not specify a scheme.*"
As in a relative file for instance. But the constructor will never accept
this since they obviously have no schema. I was hoping to fake it by
introducing the file schema on uris that don't have it and joining the
current file parent directory to make a relative uri absolute.
But why doesn't the constructor allow this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20110514/fbe920f6/attachment.html
More information about the net-dev
mailing list