ctomc/jboss-as — comment on commit 69b274e7d47ad3e74e1bad0547b3a8c485585d40
File:  line 0
By OndraZizka:

How about this
String path = "/var/data/stuff/xyz.dat";
String base = "/var/data";
String relative = new File(base).toURI().relativize(new File(path).toURI()).getPath();
// relative == "stuff/xyz.dat"