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?
org.apache.ant has a FileUtils class with a getRelativePath method. Haven't tried it myself yet, but could be worthwhile to check it out.
http://javadoc.haefelinger.it/org.apache.ant/1.7.1/org/apache/tools/ant/util/FileUtils.html#getRelativePath(java.io.File, java.io.File)