Code example for URI

Methods: getAuthoritygetUserInfo

        } catch (URISyntaxException expected) {
    public void testAtSignInUserInfo() throws Exception { 
        URI uri = new URI("");
        assertEquals("", 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");
Connect your IDE to all the code out there  Get Codota for Java