Code example for URI

Methods: getAuthority

0
        } catch (URISyntaxException expected) {
        } 
    } 
 
    public void testAtSignInUserInfo() throws Exception { 
        URI uri = new URI("http://user@userhost.com:password@host");
        assertEquals("user@userhost.com:password@host", uri.getAuthority());
        assertEquals(null, uri.getUserInfo());
        assertEquals(null, uri.getHost());
    } 
 
    public void testUserNoPassword() throws Exception { 
        URI uri = new URI("http://user@host");
        assertEquals("user@host", uri.getAuthority());
        assertEquals("user", uri.getUserInfo());
        assertEquals("host", uri.getHost());
    } 
 
    public void testUserNoPasswordExplicitPort() throws Exception { 
        URI uri = new URI("http://user@host:8080");
Stop searching for code, let great code find you!  Add Codota to your java IDE