Package javax.ws.rs.core

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


        UriBuilder builder = new UriBuilderImpl();
        builder.segment("path1");
        URI uri = builder.build();
        assertEquals("path1", uri.toString());

        builder.segment("seg1/{var1}");
        uri = builder.build("segment1");
        assertEquals("path1/seg1%2Fsegment1", uri.toString());

        builder.segment("seg2/{var1}");
        uri = builder.build("segment1");
View Full Code Here


        builder.segment("seg1/{var1}");
        uri = builder.build("segment1");
        assertEquals("path1/seg1%2Fsegment1", uri.toString());

        builder.segment("seg2/{var1}");
        uri = builder.build("segment1");
        assertEquals("path1/seg1%2Fsegment1/seg2%2Fsegment1", uri.toString());
        uri = builder.build("segment2");
        assertEquals("path1/seg1%2Fsegment2/seg2%2Fsegment2", uri.toString());
View Full Code Here

        uri = builder.build("segment1");
        assertEquals("path1/seg1%2Fsegment1/seg2%2Fsegment1", uri.toString());
        uri = builder.build("segment2");
        assertEquals("path1/seg1%2Fsegment2/seg2%2Fsegment2", uri.toString());

        builder.segment("{var2}").segment("{var1}");
        uri = builder.build("segment1", "segment2");
        assertEquals("path1/seg1%2Fsegment1/seg2%2Fsegment1/segment2/segment1", uri.toString());

        uri = builder.build("segment1", "segment2", "segment3");
        assertEquals("path1/seg1%2Fsegment1/seg2%2Fsegment1/segment2/segment1", uri.toString());
View Full Code Here

        uri = builder.build("segment1", "segment2", "segment3");
        assertEquals("path1/seg1%2Fsegment1/seg2%2Fsegment1/segment2/segment1", uri.toString());

        // vars with special character
        builder = new UriBuilderImpl();
        builder.segment("path1").segment("{var1}");
        uri = builder.build("/s1,s2");
        assertEquals("path1/%2Fs1,s2", uri.toString());

        builder.replacePath("/r1/{v1}");
        uri = builder.build("r2");
View Full Code Here

        assertEquals("r1/r2", uri.toString());
    }

    public void testMatrix() {
        UriBuilder builder = new UriBuilderImpl();
        builder.segment("path1");

        builder.matrixParam("mat1", "val1");
        String uriString = builder.build().toString();
        assertEquals("path1;mat1=val1", uriString);
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.