Package org.apache.abdera.model

Examples of org.apache.abdera.model.Link


  public IRI getEditMediaLinkResolvedHref(
    String type,
    String hreflang)
      throws IRISyntaxException,
             MimeTypeParseException {
    Link link = getEditMediaLink(type, hreflang);
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here


    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
    iri = factory.newIRIElement(Constants.ID, null);
    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
    Link link = factory.newLink();
    assertNotNull(link);
    link = factory.newLink();
    link.setHref("http://example.org/foo");
    link.setRel("a");
    link.setMimeType("text/foo");
    link.setTitle("b");
    link.setHrefLang("en");
    link.setLength(10);
    assertEquals(link.getHref().toString(), "http://example.org/foo");
    assertEquals(link.getRel(), "a");
    assertEquals(link.getMimeType().toString(), "text/foo");
    assertEquals(link.getTitle(), "b");
    assertEquals(link.getHrefLang(), "en");
    assertEquals(link.getLength(), 10);
    link = factory.newLink();
    link.setHref("http://example.org/foo");
    link.setRel("a");
    link.setMimeType("text/foo");
    link.setTitle("b");
    link.setHrefLang("en");
    link.setLength(10);
    assertEquals(link.getHref().toString(), "http://example.org/foo");
    assertEquals(link.getRel(), "a");
    assertEquals(link.getMimeType().toString(), "text/foo");
    assertEquals(link.getTitle(), "b");
    assertEquals(link.getHrefLang(), "en");
    assertEquals(link.getLength(), 10);
    iri = factory.newLogo();
    assertNotNull(iri);
    iri = factory.newLogo();
    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
View Full Code Here

    return addLink(href, null);
  }
 
  public Link addLink(String href, String rel) throws IRISyntaxException {
    FOMFactory fomfactory = (FOMFactory) factory;
    Link link = fomfactory.newLink(this);
    link.setHref(href);
    if (rel != null) link.setRel(rel);
    return link;   
  }
View Full Code Here

    return link;   
  }
 
  public Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws IRISyntaxException, MimeTypeParseException {
    FOMFactory fomfactory = (FOMFactory) factory;
    Link link = fomfactory.newLink(this);
    link.setHref(href);
    link.setRel(rel);
    link.setMimeType(type);
    link.setTitle(title);
    link.setHrefLang(hreflang);
    link.setLength(length);
    return link;
  }
View Full Code Here

        URIHelper.isMailtoUri(uri)) ? null : uri;
  }
 
  public Link getLink(String rel) {
    List<Link> self = getLinks(rel);
    Link link = null;
    if (self.size() > 0) link = self.get(0);
    return link;
  }
View Full Code Here

  public Link getAlternateLink() {
    return getLink(Link.REL_ALTERNATE);
  }

  public IRI getLinkResolvedHref(String rel) throws IRISyntaxException {
    Link link = getLink(rel);
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

  public IRI getLinkResolvedHref(String rel) throws IRISyntaxException {
    Link link = getLink(rel);
    return (link != null) ? link.getResolvedHref() : null;
  }
  public IRI getSelfLinkResolvedHref() throws IRISyntaxException {
    Link link = getSelfLink();
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

  public IRI getSelfLinkResolvedHref() throws IRISyntaxException {
    Link link = getSelfLink();
    return (link != null) ? link.getResolvedHref() : null;
  }
  public IRI getAlternateLinkResolvedHref() throws IRISyntaxException {
    Link link = getAlternateLink();
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

  public IRI getAlternateLinkResolvedHref(
    String type,
    String hreflang)
      throws IRISyntaxException,
             MimeTypeParseException {
    Link link = getAlternateLink(type, hreflang);
    return (link != null) ? link.getResolvedHref() : null;
  }
View Full Code Here

                if ( entryUpdated != null )
                    response.addHeader(LASTMODIFIED, dateFormat.format( entryUpdated ));
                // TODO Check If-Modified-Since If-Unmodified-Since predicates against LASTMODIFIED.
                // If true return 304 and null body.

                Link link = feedEntry.getSelfLink();
                if (link != null) {
                    response.addHeader(LOCATION, link.getHref().toString());
                } else {
                    link = feedEntry.getLink( "Edit" );
                    if (link != null) {
                        response.addHeader(LOCATION, link.getHref().toString());
                    }
                }

                // Test request for predicates.
                String predicate = request.getHeader( "If-Match" );
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.