Examples of replacePath()


Examples of com.linkedin.jersey.api.uri.UriBuilder.replacePath()

        int debugSegmentIndex = fullPath.indexOf(DEBUG_PATH_SEGMENT);

        RestRequestBuilder requestBuilder = new RestRequestBuilder(request);

        UriBuilder uriBuilder = UriBuilder.fromUri(request.getURI());
        uriBuilder.replacePath(request.getURI().getPath().substring(0, debugSegmentIndex - 1));
        requestBuilder.setURI(uriBuilder.build());

        handleResourceRequest(requestBuilder.build(), requestContext, callback, true);
      }
    }, callback);
View Full Code Here

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

               
        // substitute $$sgs.server with the sgs server URL
        String serverURL = ServletPropertyUtil.getProperty("jnlp.wonderland.server.url", context);
        if (serverURL == null) {
            UriBuilder builder = UriBuilder.fromUri(request.getRequestURL().toString());
            serverURL = builder.replacePath("/").build().toString();
           
            /*try {
                serverName = InetAddress.getLocalHost().getCanonicalHostName();
            } catch (UnknownHostException uhe) {
                logger.log(Level.WARNING, "Error getting local host", uhe);
View Full Code Here

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

        // substitute in the config directory
        String configDirURL = ServletPropertyUtil.getProperty("jnlp.wonderland.client.config.dir", context);
        if (configDirURL == null) {
            UriBuilder builder = UriBuilder.fromUri(request.getRequestURL().toString());
            configDirURL = builder.replacePath("/wonderland-web-front/config/").build().toString();
        }
        jnlpTemplate = substitute(jnlpTemplate, "$$wonderland.client.config.dir", configDirURL);

        // add in additional properties
        StringBuilder props = new StringBuilder();
View Full Code Here

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

     * Get the URL for this server
     * @return the server URL
     */
    protected String getServerURL() {
        UriBuilder b = uriInfo.getBaseUriBuilder();
        b.replacePath("");

        return b.build().toString();
    }
}
View Full Code Here

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

        } else {
            builder = UriBuilder.fromUri(baseUri);
            // special treatment if the path resulting from the base uri equals
            // "/"
            if (baseUri.getPath() != null && baseUri.getPath().equals("/")) {
                builder.replacePath(path);
            } else {
                builder.path(path);
            }
        }
        return builder;
View Full Code Here

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

    @Test
    public void testBuildWithNonEncodedSubstitutionValue5() {
        UriBuilder ub = UriBuilder.fromUri("/%25");
        URI uri = ub.build();
        assertEquals("/%25", uri.toString());
        uri = ub.replacePath("/%/{token}").build("{}");
        assertEquals("/%25/%7B%7D", uri.toString());       
    }
   
    @Test
    public void testBuildWithNonEncodedSubstitutionValue6() {
View Full Code Here

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

    @Test
    public void testBuildWithNonEncodedSubstitutionValue6() {
        UriBuilder ub = UriBuilder.fromPath("/");
        URI uri = ub.path("%").build();
        assertEquals("/%25", uri.toString());
        uri = ub.replacePath("/%/{token}").build("{}");
        assertEquals("/%25/%7B%7D", uri.toString());       
    }
   
    @Test
    public void testBuildWithNonEncodedSubstitutionValue7() {
View Full Code Here

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

        builder = new UriBuilderImpl();
        builder.segment("path1").segment("{var1}");
        uri = builder.build("/s1,s2");
        assertEquals("path1//s1,s2", uri.toString());

        builder.replacePath("/r1/{v1}");
        uri = builder.build("r2");
        assertEquals("/r1/r2", uri.toString());

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

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

        builder.replacePath("/r1/{v1}");
        uri = builder.build("r2");
        assertEquals("/r1/r2", uri.toString());

        builder.replacePath("r1/{v1}");
        uri = builder.build("r2");
        assertEquals("r1/r2", uri.toString());
    }

    public void testMatrix() {
View Full Code Here

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

        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();
        href = href.replaceAll("%2F","/");
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.