Code example for URI

Methods: getAuthority

0
        assertEquals("/foo", uri.getPath());
        assertEquals("file://x/foo", uri.toString());
    } 
 
    public void testEmptyAuthority() throws Exception { 
        URI uri = new URI("http:///foo");
        assertEquals(null, uri.getAuthority());
        assertEquals("/foo", uri.getPath());
        assertEquals("http:///foo", uri.toString());
    } 
 
    public void testHttpUrlExtraLeadingSlashes() throws Exception { 
        URI uri = new URI("http:////foo");
        assertEquals(null, uri.getAuthority());
        assertEquals("//foo", uri.getPath());
        assertEquals("http:////foo", uri.toString());
    } 
 
    public void testFileUrlRelativePath() throws Exception { 
        URI base = new URI("file:/a/b/c");