Code example for URI

Methods: resolve

0
        URI base = new URI("http://host/file");
        assertEquals("http://host/another#fragment", base.resolve("another#fragment").toString());
    } 
 
    public void testRelativeParentDirectory() throws Exception { 
        URI base = new URI("http://host/a/b/c");
        assertEquals("http://host/a/d", base.resolve("../d").toString());
    } 
 
    public void testRelativeChildDirectory() throws Exception { 
        URI base = new URI("http://host/a/b/c");
        assertEquals("http://host/a/b/d/e", base.resolve("d/e").toString());
    } 
 
    public void testRelativeRootDirectory() throws Exception { 
        URI base = new URI("http://host/a/b/c");
        assertEquals("http://host/d", base.resolve("/d").toString());
    } 
 
    public void testRelativeFullUrl() throws Exception {