Package javax.ws.rs.core

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


        assertEquals("//localhost:8080/some/path/pathEx/a+b/a+bc%2Bd#frag", uriString);
    }

    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();
View Full Code Here


            UriBuilder.fromUri(new URI("ftp://ftp.ftpsite.site/files/file.txt"));
        uriBuilder = uriBuilder.uri(new URI("//%2F%2Fftp.ftpsite.site/files/file.txt"));
        assertEquals("ftp://ftp.ftpsite.site/files/file.txt", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("ftp.ftpsite.site/files/file.txt"));
        uriBuilder = uriBuilder.scheme("ftp");
        uriBuilder = uriBuilder.uri(new URI("//%2F%2Fftp.ftpsite.site/files/file.txt"));
        assertEquals("ftp://ftp.ftpsite.site/files/file.txt", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("mailto:ibmuser@ibm.com"));
        uriBuilder = uriBuilder.uri(new URI("ibmuser@ibm.com"));
View Full Code Here

        uriBuilder = UriBuilder.fromUri(new URI("mailto:ibmuser@ibm.com"));
        uriBuilder = uriBuilder.uri(new URI("ibmuser@ibm.com"));
        assertEquals("mailto:ibmuser@ibm.com", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("ibmuser@ibm.com"));
        uriBuilder.scheme("mailto");
        uriBuilder = uriBuilder.uri(new URI("ibmuser@ibm.com"));
        assertEquals("mailto:ibmuser@ibm.com", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("news:ibm.com"));
        uriBuilder = uriBuilder.uri(new URI("http://ibm.com"));
View Full Code Here

        assertEquals("http://myserver/dm/atom/library/%5B@Pgistest/@RMain.nsf%5D/feed", uriBuilder.build().toString());
    }

    public void testClone() {
        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();
View Full Code Here

            UriBuilder.fromUri(new URI("ftp://ftp.ftpsite.site/files/file.txt"));
        uriBuilder = uriBuilder.uri(new URI("//%2F%2Fftp.ftpsite.site/files/file.txt"));
        assertEquals("ftp://ftp.ftpsite.site/files/file.txt", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("ftp.ftpsite.site/files/file.txt"));
        uriBuilder = uriBuilder.scheme("ftp");
        uriBuilder = uriBuilder.uri(new URI("//%2F%2Fftp.ftpsite.site/files/file.txt"));
        assertEquals("ftp://ftp.ftpsite.site/files/file.txt", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("mailto:ibmuser@ibm.com"));
        uriBuilder = uriBuilder.uri(new URI("ibmuser@ibm.com"));
View Full Code Here

        uriBuilder = UriBuilder.fromUri(new URI("mailto:ibmuser@ibm.com"));
        uriBuilder = uriBuilder.uri(new URI("ibmuser@ibm.com"));
        assertEquals("mailto:ibmuser@ibm.com", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("ibmuser@ibm.com"));
        uriBuilder.scheme("mailto");
        uriBuilder = uriBuilder.uri(new URI("ibmuser@ibm.com"));
        assertEquals("mailto:ibmuser@ibm.com", uriBuilder.build().toString());

        uriBuilder = UriBuilder.fromUri(new URI("news:ibm.com"));
        uriBuilder = uriBuilder.uri(new URI("http://ibm.com"));
View Full Code Here

        assertEquals("http://myserver/dm/atom/library/%5B@Pgistest/@RMain.nsf%5D/feed", uriBuilder.build().toString());
    }

    public void testClone() {
        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();
View Full Code Here

public class UriBuilderImplTest extends TestCase {

    public void testUriBuilderSimple() {
        UriBuilder builder = new UriBuilderImpl();
        builder.scheme("http").host("localhost").port(8080);
        builder.segment("some", "path");
        builder.segment("matrix1");
        builder.matrixParam("a", "1");
        builder.matrixParam("b", "2");
        builder.segment("matrix2");
View Full Code Here

        assertEquals("?q3&q4=b4", uriString);
    }

    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("//localhost:8080/some/path/pathEx/a+b/a+bc%2Bd#frag", uriString);
    }

    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();
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.