Package javax.ws.rs.core

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


        for (CategoryItem c : categories) {
            childExtension.addSimpleExtension(VALUE, c.getName());
        }

        org.apache.abdera.model.Content content = factory.newContent();
        content.setSrc(base.clone().path("binary").build().toString());
        content.setMimeType("application/octet-stream");
        content.setContentType(Type.MEDIA);
        e.setContentElement(content);

        return e;
View Full Code Here


        protected void setDefaultEntryProperties(Entry entry, List<LogRecord> rs, int entryIndex) {
            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

            if (!eg.isIncludedInGrammar()) {
                continue;
            }
           
            URI schemaURI =
                    extendedPath.clone().path(path).build();

            String schemaURIS = schemaURI.toString();
            String requestURIs = requestURI.toString();

            String schemaPath = rootURI != null
View Full Code Here

            // Create a reference back to the root WADL
            //

            for (String path : applicationDescription.getExternalMetadataKeys()) {
                URI schemaURI =
                        extendedPath.clone().path(path).build();

                String schemaPath = rootURI != null ?
                        requestURI.relativize(schemaURI).toString()
                        : schemaURI.toString();
View Full Code Here

        protected void setDefaultEntryProperties(Entry entry, List<LogRecord> rs, int entryIndex) {
            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

        protected void setDefaultEntryProperties(Entry entry, List<LogRecord> rs, int entryIndex) {
            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

    }

    @Test
    public void testClone() {
        UriBuilder ub = UriBuilder.fromUri("http://user@localhost:8080/?query#fragment").path("a");
        URI full = ub.clone().path("b").build();
        URI base = ub.build();

        Assert.assertEquals(URI.create("http://user@localhost:8080/a?query#fragment"), base);
        Assert.assertEquals(URI.create("http://user@localhost:8080/a/b?query#fragment"), full);
    }
View Full Code Here

   }

   public static void addPurgeLinkHeader(UriInfo uriInfo, Response.ResponseBuilder builder)
   {
      UriBuilder absolute = uriInfo.getAbsolutePathBuilder();
      String purgeUrl = absolute.clone().path("purge").build().toString();
      builder.header("Link", new Link("purge", purgeUrl, null));
   }

   public Response createOrder(Order order, UriInfo uriInfo)
   {
View Full Code Here

      // next link
      // If the size returned is equal then assume there is a next
      if (orderEntities.size() == size)
      {
         int next = start + size;
         URI nextUri = builder.clone().build(next, size);
         Link nextLink = new Link("next", nextUri.toString(), "application/xml");
         links.add(nextLink);
      }
      // previous link
      if (start > 0)
View Full Code Here

      // previous link
      if (start > 0)
      {
         int previous = start - size;
         if (previous < 0) previous = 0;
         URI previousUri = builder.clone().build(previous, size);
         Link previousLink = new Link("previous", previousUri.toString(), "application/xml");
         links.add(previousLink);
      }
      Orders orders = new Orders();
      orders.setOrders(list);
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.