Given two absolute paths, e.g.
/var/data/stuff/xyz.dat /var/data
How can one create a relative path that uses the second path as its base?
In Java 7 and later you can simply use (and in contrast to URI, it is bug free):
URI
Path#relativize(Path)