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?
If you're writing a Maven plugin, you can use Plexus' PathTool:
import org.codehaus.plexus.util.PathTool; String relativeFilePath = PathTool.getRelativeFilePath(file1, file2);