Code example for URI

Methods: getFragment

        assertEquals(-1, uri.getPort());
        assertEquals("fragment:80", uri.getFragment());
    public void testSlashInFragment() throws Exception { 
        URI uri = new URI("http://host/file#fragment/path");
        assertEquals("/file", uri.getPath());
        assertEquals("fragment/path", uri.getFragment());
    public void testHashInFragment() throws Exception { 
        try { 
            // This is not consistent with 
            new URI("http://host/file#fragment#another");
        } catch (URISyntaxException expected) {
    public void testEmptyPort() throws Exception { 
Connect your IDE to all the code out there  Get Codota for Java