Examples of IRI


Examples of com.hp.hpl.jena.iri.IRI


    static public IRIFactory f = IRIFactory.jenaImplementation();
  
    public void runTest() {
        IRI iri = f.create(uri);
        Iterator it = iri.violations(true);
        while (it.hasNext()) {
            Violation v = (Violation) it.next();
            printErrorMessages(v);
           
        }
View Full Code Here

Examples of org.apache.abdera.i18n.iri.IRI

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml";
        opts.setContentType(contentType);
        // AtomTestCaseUtils.printRequestHeaders( "Post request headers", "   ", opts );
        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        ClientResponse res = client.post(colUri.toString(), entry, opts);

        // Assert response status code is 201-OK.
        // Assert response header Content-Type: application/atom+xml; charset=UTF-8
        Assert.assertEquals(201, res.getStatus());
        String returnedContentType = res.getContentType().toString().trim();
View Full Code Here

Examples of org.apache.abdera.model.IRI

    Person person = feed.getAuthor();
    assertNotNull(person);
    assertEquals(person.getName(), "John Doe");
    assertNull(person.getEmail());
    assertNull(person.getUri());
    IRI id = feed.getIdElement();
    assertNotNull(id);
    assertEquals(id.getValue(), new URI("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6"));
    List<Entry> entries = feed.getEntries();
    assertEquals(entries.size(), 1);
    for (Entry entry : entries) {
      title = entry.getTitleElement();
      assertNotNull(title);
      assertEquals(title.getTextType(), Text.Type.TEXT);
      value = title.getValue();
      assertEquals(value, "Atom-Powered Robots Run Amok");
      links = entry.getLinks();
      assertEquals(1, links.size());
      for (Link link : links) {
        assertNull(link.getRel()); // it's an alternate link
        assertEquals(link.getHref(), new URI("http://example.org/2003/12/13/atom03"));
        assertNull(link.getHrefLang());
        assertNull(link.getMimeType());
        assertNull(link.getTitle());
        assertEquals(link.getLength(),-1);
      }
      links = entry.getLinks(Link.REL_ALTERNATE);
      assertEquals(links.size(),1);
      links = entry.getLinks(Link.REL_RELATED);
      assertEquals(links.size(),0);
      id = entry.getIdElement();
      assertNotNull(id);
      assertEquals(id.getValue(), new URI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
      assertNotNull(entry.getUpdatedElement());
      dte = entry.getUpdatedElement();
      dt = dte.getValue();
      assertNotNull(dt);
      c = dt.getCalendar();
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI

  public void setLanguage(String language) {
    setAttributeValue(LANG,language);
  }

  public IRI getBaseUri() throws IRISyntaxException {
    IRI uri = _getUriValue(getAttributeValue(BASE));
    if (URIHelper.isJavascriptUri(uri) ||
        URIHelper.isMailtoUri(uri)) { uri = null; }
    if (uri == null) {
      if (parent instanceof Element) {
        uri = ((Element)parent).getBaseUri();
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI

    }
    return uri;
  }

  public IRI getResolvedBaseUri() throws IRISyntaxException {
    IRI baseUri = null;
    IRI uri = _getUriValue(getAttributeValue(BASE));
    if (URIHelper.isJavascriptUri(uri) ||
        URIHelper.isMailtoUri(uri)) { uri = null; }
    if (parent instanceof Element)
      baseUri = ((Element)parent).getResolvedBaseUri();
    else if (parent instanceof Document)
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI

  public void setBaseUri(IRI base) {
    setAttributeValue(BASE,_getStringValue(base));
  }
 
  public void setBaseUri(String base) throws IRISyntaxException {
    setBaseUri((base != null) ? new IRI(base) : null);
  }
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI

      e.discard();
    }
  }
 
  protected IRI _getUriValue(String v) throws IRISyntaxException {
    return (v != null) ? new IRI(v) : null;
  }
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI

        "#".equals(value.toString()) ||
        ".".equals(value.toString()) ||
        "./".equals(value.toString())) return base;
    if (base == null) return value;
    if ("".equals(base.getPath())) base = base.resolve("/");
    IRI resolved = (base != null) ? base.resolve(value) : value;
    return resolved;
  }
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI

    irt.setRef(ref);
    return irt;
  }

  public static InReplyTo addInReplyTo(Entry entry, String ref) throws IRISyntaxException {
    return addInReplyTo(entry, new IRI(ref));
  }
View Full Code Here

Examples of org.apache.abdera.util.iri.IRI

    super(factory, ThreadConstants.IN_REPLY_TO);
  }

  public IRI getHref() throws IRISyntaxException {
    String href = getAttributeValue("href");
    return (href != null) ? new IRI(href) : null;
  }
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.