How to .resolve*() and .relativize() Paths which are not issued from the same FileSystem?

Alan Bateman Alan.Bateman at oracle.com
Mon Dec 1 08:52:31 UTC 2014


On 30/11/2014 21:47, Francis Galiegue wrote:
> :
> OK, that makes sense -- however I didn't know that the first path was
> valid at all; or even whether it can represent anything at all...
It just provides access to file "foo" in the working directory of drive 
"C:".



> :
> Well, if you cannot convert from/to the necessary byte array, you are
> supposed to throw an InvalidPathException, correct? In UnixPath I see
> that a Charset{De,En}coder is used for these purposes with a
> CodingErrorAction of REPORT.
As it's all the one file system provider then you shouldn't need to do 
any encoding or decoding.

> :
>
>
> And there's even a contradiction there: what is "the empty path"? An
> empty path attached to the file system of "path" or "other"? On Linux,
> it returns "other" unconditionally, which says it's the first part
> which takes precedence.
>
> So, should this last part of the documentation be removed?
>
The empty path is defined is in the class description. I don't see any 
obvious with the resolveSibling's javadoc, it' just trying to be 
explicit as to how it behaves when the the path or given path is the 
empty path.

-Alan


More information about the nio-dev mailing list