Feedback please? MorePaths.resolve()

Francis Galiegue fgaliegue at gmail.com
Thu Dec 18 06:08:04 UTC 2014


Some of you may remind the discussion I had with Mr Bateman about
filesystem issues when resolving paths (that is, which filesystem the
result will belong to).

Actually, the resulting paths between the two resolve() methods (the
one taking a String as an argument and the one taking a Path as an
argument) may not be equal because they don't have the same filesystem
(the string version will always return a path which belongs to the
caller's filesystem; not the path version).

And what is more, even if both paths share the same path structure, if
they are from a different provider you cannot resolve
(ProviderMismatchException).

Since it can be practical to resolve paths against one another even if
they are issued from different providers, and in order to ensure that
they are both on the same filesystem, I wrote such a method:

https://gist.github.com/fge/34e93d9dca4f56c27d16

Comments?

-- 
Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)


More information about the nio-dev mailing list