Package javax.ws.rs.core

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


      RESTServiceDiscovery ret, LinkResource service, String rel) {
    Map<String, ? extends Object> pathParameters = entity.pathParameters();
    // do we need any path parameters?
    UriBuilder uriBuilder = uriInfo.getBaseUriBuilder().path(m.getDeclaringClass());
    if(m.isAnnotationPresent(Path.class))
      uriBuilder.path(m);
    URI uri;
    List<String> paramNames = ((UriBuilderImpl)uriBuilder).getPathParamNamesInDeclarationOrder();
    if(paramNames.isEmpty())
      uri = uriBuilder.build();
    else if(pathParameters.size() >= paramNames.size())
View Full Code Here


  private static void addInstanceService(Method m, Object entity,
      UriInfo uriInfo, RESTServiceDiscovery ret, LinkResource service,
      String rel) {
    UriBuilder uriBuilder = uriInfo.getBaseUriBuilder().path(m.getDeclaringClass());
    if(m.isAnnotationPresent(Path.class))
      uriBuilder.path(m);
    URI uri = buildURI(uriBuilder, service, entity, m);

    if (rel.length() == 0) {
      if (m.isAnnotationPresent(GET.class)){
        Class<?> type = m.getReturnType();
View Full Code Here

       return Response.ok().type("text/plain").entity(response).build();
   }
  
   private String getCallbackURI() {
       UriBuilder ub = ui.getBaseUriBuilder();
       return ub.path(ConsumerResource.class).path("token-authorization").build().toString();
   }
  
   public String getSharedSecret(String consumerKey) throws Exception
   {
      HttpClient client = new HttpClient();
View Full Code Here

      protected String getSenderLink(UriInfo info)
      {
         String basePath = info.getMatchedURIs().get(0);
         UriBuilder builder = info.getBaseUriBuilder();
         builder.path(basePath);
         builder.path("sender");
         String link = "<" + builder.build().toString() + ">; rel=\"sender\"; title=\"sender\"";
         return link;
      }
View Full Code Here

      protected String getSenderLink(UriInfo info)
      {
         String basePath = info.getMatchedURIs().get(0);
         UriBuilder builder = info.getBaseUriBuilder();
         builder.path(basePath);
         builder.path("sender");
         String link = "<" + builder.build().toString() + ">; rel=\"sender\"; title=\"sender\"";
         return link;
      }

      protected String getTopLink(UriInfo info)
View Full Code Here

      protected String getTopLink(UriInfo info)
      {
         String basePath = info.getMatchedURIs().get(0);
         UriBuilder builder = info.getBaseUriBuilder();
         builder.path(basePath);
         builder.path("poller");
         String link = "<" + builder.build().toString() + ">; rel=\"top-message\"; title=\"top-message\"";
         return link;
      }
View Full Code Here

      protected String getTopLink(UriInfo info)
      {
         String basePath = info.getMatchedURIs().get(0);
         UriBuilder builder = info.getBaseUriBuilder();
         builder.path(basePath);
         builder.path("poller");
         String link = "<" + builder.build().toString() + ">; rel=\"top-message\"; title=\"top-message\"";
         return link;
      }

   }
View Full Code Here

       }
   }
  
   private String getCallbackURI() {
       UriBuilder ub = ui.getBaseUriBuilder();
       return ub.path(SubscriberReceiver.class).build().toString();
   }
  
   public void registerMessagingServiceCallback(String consumerKey, String callback)
   {
      try
View Full Code Here

            super.setDefaultEntryProperties(entry, rs, entryIndex);
            UriBuilder builder = context.getUriInfo().getAbsolutePathBuilder().path("entry");
            Integer realIndex = page == 1 ? entryIndex : page * pageSize + entryIndex;

            entry.addLink(builder.clone().path(realIndex.toString()).build().toString(), "self");
            entry.addLink(builder.path("alternate").path(realIndex.toString()).build().toString(),
                          "alternate");
        }
       
    }
   
View Full Code Here

        this.serverStatus = serverStatus;
    }

    public List<InputSummaryResponse> getPersistedInputs() throws IOException {
        final UriBuilder uriBuilder = UriBuilder.fromUri(serverUrl);
        uriBuilder.path("/system/radios/" + serverStatus.getNodeId().toString() + "/inputs");

        final Request request = httpclient.prepareGet(uriBuilder.build().toString()).build();
        LOG.debug("API Request {} {}", request.getMethod(), request.getUrl());
        final Future<Response> f = httpclient.executeRequest(request);
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.