Code example for URI

Methods: getAuthority

0
        } catch (URISyntaxException expected) {
        } 
    } 
 
    public void testFileUriExtraLeadingSlashes() throws Exception { 
        URI uri = new URI("file:////foo");
        assertEquals(null, uri.getAuthority());
        assertEquals("//foo", uri.getPath());
        assertEquals("file:////foo", uri.toString());
    } 
 
    public void testFileUrlWithAuthority() throws Exception { 
        URI uri = new URI("file://x/foo");
        assertEquals("x", uri.getAuthority());
        assertEquals("/foo", uri.getPath());
        assertEquals("file://x/foo", uri.toString());
    } 
 
    public void testEmptyAuthority() throws Exception { 
        URI uri = new URI("http:///foo");
Experience pair programming with AI  Get Codota for Java