Package javax.ws.rs.core

Examples of javax.ws.rs.core.UriBuilder.fragment()


        builder.segment("matrix1");
        builder.matrixParam("a", "1");
        builder.matrixParam("b", "2");
        builder.segment("matrix2");
        builder.matrixParam("c", "3");
        builder.fragment("fragment");
        URI uri = builder.build();
        assertEquals("http://localhost:8080/some/path/matrix1;a=1;b=2/matrix2;c=3#fragment", uri
            .toString());
    }
View Full Code Here


        String urlBase = template.getUrl();
        String replaced = String.format(urlBase, entityId);

        UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
        uriBuilder.fragment(replaced);
        uriBuilder.replacePath("coregui/"); // trailing / is needed

        URI uri = uriBuilder.build();

        String href = uri.toString();
View Full Code Here

    }

    public void testSchemeSpecificPart() {
        UriBuilder builder = new UriBuilderImpl();
        builder.scheme("http");
        builder.fragment("frag");

        builder.schemeSpecificPart("//iamlegend.hp.com@localhost:80/path1/{var1}/path3");
        String uriStr = builder.build("path2").toString();
        assertEquals("http://iamlegend.hp.com@localhost:80/path1/path2/path3#frag", uriStr);
View Full Code Here

        assertEquals("http://path4/path5#frag", uriStr);
    }

    public void testFragment() {
        UriBuilder builder = new UriBuilderImpl();
        builder.fragment("fragment");
        String uriString = builder.build().toString();
        assertEquals("#fragment", uriString);

        builder.fragment("{var}");
        uriString = builder.build("fragment").toString();
View Full Code Here

        UriBuilder builder = new UriBuilderImpl();
        builder.fragment("fragment");
        String uriString = builder.build().toString();
        assertEquals("#fragment", uriString);

        builder.fragment("{var}");
        uriString = builder.build("fragment").toString();
        assertEquals("#fragment", uriString);

        builder.fragment("{var}");
        uriString = builder.build("frag#@ment").toString();
View Full Code Here

        builder.fragment("{var}");
        uriString = builder.build("fragment").toString();
        assertEquals("#fragment", uriString);

        builder.fragment("{var}");
        uriString = builder.build("frag#@ment").toString();
        assertEquals("#frag%23@ment", uriString);
    }

    public void testBuildMethods() {
View Full Code Here

    public void testUri() throws Exception {
        UriBuilder builder = new UriBuilderImpl();
        builder.scheme("http").host("localhost").port(80).segment("path1", "path2");
        builder.matrixParam("mat1", "{var1}", "v2");
        builder.fragment("fragment");
        URI uri = URI.create("http://iamlegend@remotehost:90/path3;mat2=v1/path4#this%20fragment");
        builder.uri(uri);
        String uriStr = builder.build().toString();
        assertEquals("http://iamlegend@remotehost:90/path3;mat2=v1/path4#this%20fragment", uriStr);
View Full Code Here

        UriBuilder builder1 = new UriBuilderImpl();
        builder1.scheme("http").host("localhost").port(80);
        builder1.segment("path1", "path2");
        builder1.matrixParam("mat1", "{var1}", "v2");
        builder1.queryParam("q1", "abc");
        builder1.fragment("fragment");
        UriBuilder builder2 = builder1.clone();
        String uri1 = builder1.build("v1").toString();
        String uri2 = builder2.build("v1").toString();
        assertEquals(uri1, uri2);
        assertNotSame(builder1, builder2);
View Full Code Here

        builder.segment("matrix1");
        builder.matrixParam("a", "1");
        builder.matrixParam("b", "2");
        builder.segment("matrix2");
        builder.matrixParam("c", "3");
        builder.fragment("fragment");
        URI uri = builder.build();
        assertEquals("http://localhost:8080/some/path/matrix1;a=1;b=2/matrix2;c=3#fragment", uri
            .toString());
    }
View Full Code Here

    }

    public void testSchemeSpecificPart() {
        UriBuilder builder = new UriBuilderImpl();
        builder.scheme("http");
        builder.fragment("frag");

        builder.schemeSpecificPart("//iamlegend.hp.com@localhost:80/path1/{var1}/path3");
        String uriStr = builder.build("path2").toString();
        assertEquals("http://iamlegend.hp.com@localhost:80/path1/path2/path3#frag", uriStr);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.