Package org.apache.abdera.util.iri

Examples of org.apache.abdera.util.iri.IRI.resolve()


  }

  public IRI getResolvedHref() throws IRISyntaxException {
    IRI href = getHref();
    IRI base = getBaseUri();
    return (base == null) ? href : (href != null) ? base.resolve(href) : null;
  }

  public IRI getResolvedSource() throws IRISyntaxException {
    IRI href = getSource();
    IRI base = getBaseUri();
View Full Code Here


  }

  public IRI getResolvedSource() throws IRISyntaxException {
    IRI href = getSource();
    IRI base = getBaseUri();
    return (base == null) ? href : (href != null) ? base.resolve(href) : null;
  }

  public IRI getSource() throws IRISyntaxException {
    String source = getAttributeValue("source");
    return (source != null) ? new IRI(source) : null;
View Full Code Here

              OMAttribute attr = (OMAttribute) o;
              Element element = (Element) context.getNavigator().getParentNode(attr);
              baseUri = element.getBaseUri();
            }
            if (baseUri != null) {
              resolved = baseUri.resolve(value);
              results.add(resolved);
            }
          } catch (Exception e) {}
        }
      } else {
View Full Code Here

     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       Content content = entry.getContentElement();
       assertNotNull(content);
       assertEquals(content.getContentType(), Content.Type.MEDIA);
       assertEquals(content.getResolvedSrc(), uri.resolve("2003/12/12/atom03.pdf"));
     }
   }
  
   public static void testSection4132ContentSrcTypeHtml() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.1.3.2/content-src-type-html.xml
View Full Code Here

     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     Generator generator = feed.getGenerator();
     assertNotNull(generator);
     assertEquals(generator.getResolvedUri(), uri.resolve("misc/Colophon"));
   }
  
   public static void testSection425IconInvalidUri() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.2.5/icon_invalid_uri.xml
     IRI uri = baseURI.resolve("4.2.5/icon_invalid_uri.xml");
View Full Code Here

     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     assertNotNull(feed.getIconElement());
     assertEquals(feed.getIconElement().getResolvedValue(), uri.resolve("favicon.ico"));
   }
  
   public static void testSection426IdDotSegments() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.2.6/id-dot-segments.xml
     IRI uri = baseURI.resolve("4.2.6/id-dot-segments.xml");
View Full Code Here

     Feed feed = doc.getRoot();
     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       List<Link> links = entry.getLinks();
       for (Link link : links) {
         assertEquals(link.getResolvedHref(), uri.resolve("/2003/12/13/atom03"));
       }
     }
   }
  
   public static void testSection427LinkNoHref() throws Exception {
View Full Code Here

     Document<Feed> doc = get(uri);
     assertNotNull(doc);
    
     Feed feed = doc.getRoot();
     assertNotNull(feed.getLogoElement());
     assertEquals(feed.getLogoElement().getResolvedValue(), uri.resolve("atomlogo.png"));
   }
  
   public static void testSection429PublishedInvalidDate() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.2.9/published-invalid-date.xml
     IRI uri = baseURI.resolve("4.2.9/published-invalid-date.xml");
View Full Code Here

      "xhtml-entity.atom",
      "xhtml-ncr.atom"};
    IRI baseUri = new IRI("http://atomtests.philringnalda.com/tests/item/title/");
    int n = 1;
    for (String test : tests) {
      Document<Feed> doc = get(baseUri.resolve(test));
      assertNotNull(doc);
      Feed feed = doc.getRoot();
      Entry entry = feed.getEntries().get(0);
      assertNotNull(entry);
      Text title = entry.getTitleElement();
View Full Code Here

    Feed feed = doc.getRoot();
    assertNotNull(feed);
    List<Person> contr = feed.getContributors();
    for (Person person : contr) {
      assertEquals(person.getUriElement().getValue(), new IRI("~jane/"));
      assertEquals(person.getUriElement().getResolvedValue(), uri.resolve("~jane/"));
    }
  }
 
  public static void testSection323EmailRss20Style() throws Exception {
    //http://feedvalidator.org/testcases/atom/3.2.3/email-rss20-style.xml
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.