Created a utility method for determining relative paths so that we could
get rid of some of the boiler-plate from using the Java APIs directly.