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?
The bug referred to in another answer is addressed by URIUtils in Apache HttpComponents
public static URI resolve(URI baseURI, String reference)
Resolves a URI reference against a base URI. Work-around for bug in java.net.URI ()