Package javax.ws.rs.core

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


   private Response internalPostWithId(String dupId, Boolean durable, Long ttl, Long expiration, Integer priority, HttpHeaders headers, UriInfo uriInfo, byte[] body) {
      String matched = uriInfo.getMatchedURIs().get(1);
      UriBuilder nextBuilder = uriInfo.getBaseUriBuilder();
      String nextId = generateDupId();
      nextBuilder.path(matched).path(nextId);
      URI next = nextBuilder.build();

      boolean isDurable = defaultDurable;
      if (durable != null)
      {
View Full Code Here


   }

   protected String createPushSubscriptionsLink(UriInfo info)
   {
      UriBuilder builder = info.getRequestUriBuilder();
      builder.path("push-subscriptions");
      String uri = builder.build().toString();
      return uri;
   }

   public void setSubscriptions(SubscriptionsResource subscriptions)
View Full Code Here

    }

    private ResourceLink generateResourceLink(Resource source, String id, UriInfo uriInfo) {
        UriBuilder builder = uriInfo.getBaseUriBuilder();

        URI uri = builder.path(BookmarkResource.class)
            .path(getResourceTypeName(source))
            .path(id)
            .build();

        return new ResourceLink("bookmark", uri, source.getResourceMediaType());
View Full Code Here

            if (httpBasePath != null) {
                builder = UriBuilder.fromPath(httpBasePath);
            } else {
                builder = mc.getUriInfo().getBaseUriBuilder();
            }
            return builder.path(path).path(xmlResourceOffset).build().toString();
        } else {
            return path;
        }
    }
   
View Full Code Here

        String baseURIPath = newBaseURI.getRawPath();
        String reqURIPath = requestURI.getRawPath();
       
        UriBuilder builder = UriBuilder.fromUri(newBaseURI);
        String basePath = reqURIPath.startsWith(baseURIPath) ? baseURIPath : getBaseURI().getRawPath();
        builder.path(reqURIPath.equals(basePath) ? "" : reqURIPath.substring(basePath.length()));
        URI newRequestURI = builder.replaceQuery(requestURI.getRawQuery()).build();
       
        resetBaseAddress(newBaseURI);
        URI current = proxy ? newBaseURI : newRequestURI;
        resetCurrentBuilder(current);
View Full Code Here

        String baseURIPath = newBaseURI.getRawPath();
        String reqURIPath = requestURI.getRawPath();
       
        UriBuilder builder = new UriBuilderImpl().uri(newBaseURI);
        String basePath = reqURIPath.startsWith(baseURIPath) ? baseURIPath : getBaseURI().getRawPath();
        builder.path(reqURIPath.equals(basePath) ? "" : reqURIPath.substring(basePath.length()));
        URI newRequestURI = builder.replaceQuery(requestURI.getRawQuery()).build();
       
        resetBaseAddress(newBaseURI);
        URI current = proxy ? newBaseURI : newRequestURI;
        resetCurrentBuilder(current);
View Full Code Here

            if (httpBasePath != null) {
                builder = UriBuilder.fromPath(httpBasePath);
            } else {
                builder = mc.getUriInfo().getBaseUriBuilder();
            }
            return builder.path(path).path(xmlResourceOffset).build().toString();
        } else {
            return path;
        }
    }
   
View Full Code Here

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

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

    }
   
    @Test
    public void testBuildWithNonEncodedSubstitutionValue4() {
        UriBuilder ub = UriBuilder.fromPath("/");
        URI uri = ub.path("{a}").build("%");
        assertEquals("/%25", uri.toString());
        uri = ub.path("{token}").build("%", "{}");
        assertEquals("/%25/%7B%7D", uri.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.