Package javax.ws.rs.core

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


        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


        org.apache.abdera.model.Entry e = factory.getAbdera().newEntry();
        e.setTitle(p.getTitle());
        e.setSummary(p.getDescription());
        e.setPublished(new Date(p.getLastModified().getTimeInMillis()));
        e.setBaseUri(base.clone().build().toString());
        e.addAuthor(p.getLastContributor());

        e.setId(base.clone().build().toString());

        Iterator<AssetItem> i = p.getAssets();
View Full Code Here

        e.setSummary(p.getDescription());
        e.setPublished(new Date(p.getLastModified().getTimeInMillis()));
        e.setBaseUri(base.clone().build().toString());
        e.addAuthor(p.getLastContributor());

        e.setId(base.clone().build().toString());

        Iterator<AssetItem> i = p.getAssets();
        while (i.hasNext()) {
            AssetItem item = i.next();
            org.apache.abdera.model.Link l = factory.newLink();
View Full Code Here

        Iterator<AssetItem> i = p.getAssets();
        while (i.hasNext()) {
            AssetItem item = i.next();
            org.apache.abdera.model.Link l = factory.newLink();
            l.setHref((base.clone().path("assets").path(item.getName())).build().toString());
            l.setTitle(item.getTitle());
            l.setRel("asset");
            e.addLink(l);
        }
View Full Code Here

        childExtension = extension.addExtension(STATE);
        childExtension.addSimpleExtension(VALUE, p.getState() == null ? "" : p.getState().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

        org.apache.abdera.model.Entry e = factory.getAbdera().newEntry();
        e.setTitle(a.getTitle());
        e.setSummary(a.getDescription());
        e.setPublished(new Date(a.getLastModified().getTimeInMillis()));
        e.setBaseUri(base.clone().build().toString());
        e.addAuthor(a.getLastContributor());

        e.setId(base.clone().build().toString());

/*        Iterator<AssetItem> i = p.getAssets();
View Full Code Here

        e.setSummary(a.getDescription());
        e.setPublished(new Date(a.getLastModified().getTimeInMillis()));
        e.setBaseUri(base.clone().build().toString());
        e.addAuthor(a.getLastContributor());

        e.setId(base.clone().build().toString());

/*        Iterator<AssetItem> i = p.getAssets();
while (i.hasNext()) {
    AssetItem item = i.next();
    org.apache.abdera.model.Link l = factory.newLink();
View Full Code Here

        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

{
   @HEAD
   public Response head(@Context UriInfo uriInfo)
   {
      UriBuilder absolute = uriInfo.getBaseUriBuilder();
      String customerUrl = absolute.clone().path("customers").build().toString();
      String orderUrl = absolute.clone().path("orders").build().toString();

      Response.ResponseBuilder builder = Response.ok();
      builder.header("Link", new Link("customers", customerUrl, "application/xml"));
      builder.header("Link", new Link("orders", orderUrl, "application/xml"));
View Full Code Here

   @HEAD
   public Response head(@Context UriInfo uriInfo)
   {
      UriBuilder absolute = uriInfo.getBaseUriBuilder();
      String customerUrl = absolute.clone().path("customers").build().toString();
      String orderUrl = absolute.clone().path("orders").build().toString();

      Response.ResponseBuilder builder = Response.ok();
      builder.header("Link", new Link("customers", customerUrl, "application/xml"));
      builder.header("Link", new Link("orders", orderUrl, "application/xml"));
      return builder.build();
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.