Package org.apache.abdera.model

Examples of org.apache.abdera.model.Link


  public static InReplyTo addInReplyTo(Entry entry, Entry ref) {
    if (ref.equals(entry)) return null;
    InReplyTo irt = addInReplyTo(entry);
    try {
      irt.setRef(ref.getId());
      Link altlink = ref.getAlternateLink();
      if (altlink != null) {
        irt.setHref(altlink.getResolvedHref());
        if (altlink.getMimeType() != null)
          irt.setMimeType(altlink.getMimeType());
      }
      Source src = ref.getSource();
      if (src != null) {
        Link selflink = src.getSelfLink();
        if (selflink != null)
          irt.setSource(selflink.getResolvedHref());
      }
    } catch (Exception e) {}
    return irt;
  }
View Full Code Here


   * @param feed The feed
   * @param iri The IRI of the next feed document
   * @return The newly created Link
   */
  public static Link setNext(Feed feed, String iri) throws IRISyntaxException {
    Link link = feed.getLink("next");
    if (link != null) {
      link.setHref(iri);
    } else {
      link = feed.addLink(iri, "next");
    }
    return link;
  }
View Full Code Here

   * @param feed The feed
   * @param iri The IRI of the previous feed document
   * @return The newly created Link
   */
  public static Link setPrevious(Feed feed, String iri) throws IRISyntaxException {
    Link link = feed.getLink("previous");
    if (link != null) {
      link.setHref(iri);
    } else {
      link = feed.addLink(iri, "previous");
    }
    return link;
  }
View Full Code Here

   * @param feed The feed
   * @param iri The IRI of the first feed document
   * @return The newly created Link
   */
  public static Link setFirst(Feed feed, String iri) throws IRISyntaxException {
    Link link = feed.getLink("first");
    if (link != null) {
      link.setHref(iri);
    } else {
      link = feed.addLink(iri, "first");
    }
    return link;
  }
View Full Code Here

   * @param feed The feed
   * @param iri The IRI of the last feed document
   * @return The newly created Link
   */
  public static Link setLast(Feed feed, String iri) throws IRISyntaxException {
    Link link = feed.getLink("last");
    if (link != null) {
      link.setHref(iri);
    } else {
      link = feed.addLink(iri, "last");
    }
    return link;
  }
View Full Code Here

   * @param feed The feed
   * @param iri The IRI of the next archive feed document
   * @return The newly created Link
   */
  public static Link setNextArchive(Feed feed, String iri) throws IRISyntaxException {
    Link link = feed.getLink("next-archive");
    if (link == null) { // try the full IANA URI version
      link = feed.getLink(Link.IANA_BASE + "next-archive");
    }
    if (link != null) {
      link.setHref(iri);
    } else {
      link = feed.addLink(iri, "next-archive");
    }
    return link;
  }
View Full Code Here

   * @param feed The feed
   * @param iri The IRI of the previous archive feed document
   * @return The newly created Link
   */
  public static Link setPreviousArchive(Feed feed, String iri) throws IRISyntaxException {
    Link link = feed.getLink("prev-archive");
    if (link == null) { // try the full IANA URI version
      link = feed.getLink(Link.IANA_BASE + "prev-archive");
    }
    if (link != null) {
      link.setHref(iri);
    } else {
      link = feed.addLink(iri, "prev-archive");
    }
    return link;
  }
View Full Code Here

   * @param feed The feed
   * @param iri The IRI of the current feed document
   * @return The newly created Link
   */
  public static Link setCurrent(Feed feed, String iri) throws IRISyntaxException {
    Link link = feed.getLink("current");
    if (link == null) { // try the full IANA URI version
      link = feed.getLink(Link.IANA_BASE + "current");
    }
    if (link != null) {
      link.setHref(iri);
    } else {
      link = feed.addLink(iri, "current");
    }
    return link;
  }
View Full Code Here

 
  /**
   * Returns the IRI of the next link relation
   */
  public static IRI getNext(Feed feed) throws IRISyntaxException {
    Link link = feed.getLink("next");
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

 
  /**
   * Returns the IRI of the previous link relation
   */
  public static IRI getPrevious(Feed feed) throws IRISyntaxException {
    Link link = feed.getLink("previous");
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Link

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.