[nio-path] Is there a connection between "C:\" and "C:"?
Alan Bateman
Alan.Bateman at oracle.com
Mon Dec 29 08:32:30 UTC 2014
On 22/12/2014 14:23, Weijun Wang wrote:
> These 2 are all root paths, but is there any API that shows a
> connection between them?
>
> I don't want to consult the actual file system (i.e. calling
> toRealPath() or toAbsolutePath()).
I think more context is needed to understand what you mean by "shows a
connection". Clearly you can use toRealPath and check if they are equal,
or you could use Files.getFileStore and check if both paths are to
directories on the same FileStore. However in both cases you will need
to access the file system.
-Alan
More information about the nio-dev
mailing list