Code example for URI

Methods: getQuery

0
        URI uri = new URI("http://host/file:colon");
        assertEquals("/file:colon", uri.getPath());
    } 
 
    public void testSlashInQuery() throws Exception { 
        URI uri = new URI("http://host/file?query/path");
        assertEquals("/file", uri.getPath());
        assertEquals("query/path", uri.getQuery());
    } 
 
    public void testQuestionMarkInQuery() throws Exception { 
        URI uri = new URI("http://host/file?query?another");
        assertEquals("/file", uri.getPath());
        assertEquals("query?another", uri.getQuery());
    } 
 
    public void testAtSignInQuery() throws Exception { 
        URI uri = new URI("http://host/file?query@at");
        assertEquals("/file", uri.getPath());
        assertEquals("query@at", uri.getQuery());
    }