Networking Java Book

Resolution is the process of resolving one URI against another URI.
The resulting URI is constructed from components of both URIs. Check http://tools.ietf.org/html/rfc2396 for the details.
Resolution of both absolute and relative URIs, and of both absolute and relative paths in the case of hierarchical URIs, is supported.
URI declares
URI resolve(String str)
and
URI resolve(URI uri)
methods for resolving the original URI argument against the base URI contained in the current URI object.
import java.net.URI;
import java.net.URISyntaxException;
public class Main {
public static void main(String[] args) throws URISyntaxException {
URI uri = new URI("http://rntsoft.com/");
System.out.println("Resolved URI = " + uri.resolve("/index.htm"));
}
}
Output:
//Resolved URI = http://rntsoft.com/index.htm