Package org.apache.wink.common.model.synd

Examples of org.apache.wink.common.model.synd.SyndLink


    }

    protected SyndLink createLink(String rel, MediaType type, URI href) {
        // convert the link to be absolute or relative
        String hrefStr = resolveLink(href);
        return new SyndLink(rel, (type != null ? type.toString() : null), hrefStr);
    }
View Full Code Here


    private List<SyndLink> getLinksAsSynd() {
        List<SyndLink> authors = new ArrayList<SyndLink>();
        for (AtomLink value : getLinks()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndLink()));
            }
        }
        return authors;
    }
View Full Code Here

    private List<SyndLink> getLinksAsSynd() {
        List<SyndLink> authors = new ArrayList<SyndLink>();
        for (AtomLink value : getLinks()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndLink()));
            }
        }
        return authors;
    }
View Full Code Here

    }

    protected SyndFeed getSyndFeed(String path) {
        SyndFeed feed = new SyndFeed();
        feed.setTitle(new SyndText(""));
        feed.addLink(new SyndLink(AtomConstants.ATOM_REL_EDIT, null, path));
        return feed;
    }
View Full Code Here

                .getCollections(uriInfo)) {
                // only collection without template URI
                if (!isTemplateUri(subCollection.getUri())) {
                    SyndFeed subFeed = new SyndFeed();
                    subFeed.setTitle(new SyndText(subCollection.getTitle()));
                    subFeed.addLink(new SyndLink(AtomConstants.ATOM_REL_EDIT, null, subCollection
                        .getUri()));
                    collectionsList.add(subFeed);
                }
            }
            return collectionsList;
View Full Code Here

     * @throws WebApplicationException if neither the 'edit' nor the 'self'
     *             links exist.
     */
    private String getResourceLink(SyndBase synd) {
        // try 'edit' link
        SyndLink link = synd.getLink("edit");
        if (link == null) {
            // try 'self' link
            link = synd.getLink("self");
        }
        if (link == null) {
            // no link in the resource
            logger.error("The resource {} has set no edit or self link", synd.getId());
            throw new WebApplicationException();
        }

        URI uri = URI.create(link.getHref()).normalize();
        if (!uri.isAbsolute()) {
            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
View Full Code Here

     * @throws WebApplicationException if neither the 'edit' nor the 'self'
     *             links exist.
     */
    private String getResourceLink(SyndBase synd) {
        // try 'edit' link
        SyndLink link = synd.getLink("edit");
        if (link == null) {
            // try 'self' link
            link = synd.getLink("self");
        }
        if (link == null) {
            // no link in the resource
            logger.error(Messages.getMessage("webDAVNoEditOrSelfLink"), synd.getId());
            throw new WebApplicationException();
        }

        URI uri = URI.create(link.getHref()).normalize();
        if (!uri.isAbsolute()) {
            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
View Full Code Here

    private List<SyndLink> getLinksAsSynd() {
        List<SyndLink> authors = new ArrayList<SyndLink>();
        for (AtomLink value : getLinks()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndLink()));
            }
        }
        return authors;
    }
View Full Code Here

        return build(out, builder);
    }

    private List<SyndLink> build(List<SyndLink> out, UriBuilder builder) {
        if (AtomConstants.ATOM_REL_SELF.equals(rel) || AtomConstants.ATOM_REL_EDIT.equals(rel)) {
            SyndLink link = getLink(out, rel);
            if (link != null) {
                out.remove(link);
            }
        }
        URI href = builder.buildFromEncodedMap(pathParams);
View Full Code Here

     * @throws WebApplicationException if neither the 'edit' nor the 'self'
     *             links exist.
     */
    private String getResourceLink(SyndBase synd) {
        // try 'edit' link
        SyndLink link = synd.getLink("edit"); //$NON-NLS-1$
        if (link == null) {
            // try 'self' link
            link = synd.getLink("self"); //$NON-NLS-1$
        }
        if (link == null) {
            // no link in the resource
            logger.error(Messages.getMessage("webDAVNoEditOrSelfLink", synd.getId())); //$NON-NLS-1$
            throw new WebApplicationException();
        }

        URI uri = URI.create(link.getHref()).normalize();
        if (!uri.isAbsolute()) {
            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.synd.SyndLink

Copyright © 2018 www.massapicom. 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.