When using java.net.URI.relativize you should be aware of Java bug: JDK-6226081 (URI should be able to relativize paths with partial roots)
At the moment, the
relativize()
method ofURI
will only relativize URIs when one is a prefix of the other.
Which essentially means java.net.URI.relativize
will not create ".."'s for you.