Trouble understanding the meaning of the API
Alan Bateman
Alan.Bateman at Sun.COM
Fri Feb 5 06:15:52 PST 2010
Marcel Ammerlaan wrote:
> Thanks for the answers so far. On the equality: if was refering to
> Path equality, not String equality.
> So the requirement on toString() would be:
> Path p1 = FileSystem.getPath("/bin/ls");
> Path p2 = FileSystem.getPath(p1.toString());
> p1.equals(p2) == true
>
> Should filesystem providers at least adhere to this requirement?
You can't guarantee this as it may involve round-trip conversions -- eg:
providers that use bytes rather than unicode strings in the path
representation.
-Alan.
More information about the nio-discuss
mailing list