Package fi.luomus.commons.utils

Examples of fi.luomus.commons.utils.URIBuilder


        return feedEntries;
    }

  private URI getLinkToDocumentOrIfDeletedLinkToEmptyDarwinRecordSet(String namespace, Node entry) throws URISyntaxException {
    if (entry.hasChildNodes(namespace+"link")) {
      URI documentURI = new URIBuilder(entry.getNode(namespace+"link").getAttribute("href")).getURI();
      documentURI = withParameters(documentURI);
      return documentURI;
    }
    if (entry.hasChildNodes(namespace+"deleted")) {
      return new URI("http://koivu.luomus.fi/files/EmpyDarwinRecordSet.xml");
View Full Code Here


    throw new IllegalStateException("No link to document!");
  }
 
    @Override
    public List<FeedEntryWithSeqID> getFeedEntriesFromSeq(URI uri, long seqId, int limit) throws FeedReaderClientException {
        return getFeedEntries(new URIBuilder(uri.toString()).addParameter("from", seqId), limit);
    }
View Full Code Here

        return getFeedEntries(new URIBuilder(uri.toString()).addParameter("from", seqId), limit);
    }

    @Override
    public List<FeedEntryWithSeqID> getFeedEntriesSinceTimestamp(URI uri, long timestamp, int limit) throws FeedReaderClientException {
        return getFeedEntries(new URIBuilder(uri.toString()).addParameter("timestamp", timestamp), limit);
    }
View Full Code Here

        return builder;
    }

    private URI withParameters(URI uri) throws URISyntaxException {
        return withParameters(new URIBuilder(uri.toString())).getURI();
    }
View Full Code Here

  @Override
  public Document search(String searchword, String checklist) throws Exception {
    HttpClientService client = null;
    try {
      client = new HttpClientService();
      URIBuilder uri = new URIBuilder(getTriplestoreBaseURL() + "/taxon-search/" + Utils.urlEncode(searchword));
      if (given(checklist)) {
        uri.addParameter("checklist", checklist);
      }
      Document response = client.contentAsDocument(new HttpGet(uri.getURI()));
      return response;
    } finally {
      if (client != null) client.close();
    }
  }
View Full Code Here

        if (client != null) client.close();
      }
    }
    private List<Checklist> loadUsingClient(HttpClientService client) throws Exception {
      List<Checklist> checklists = new ArrayList<Checklist>();
      URIBuilder uri = new URIBuilder(config.get("TriplestoreURL") + "/search)")
      .addParameter("predicate", "rdf:type")
      .addParameter("object", "dc:BibliographicResource");

      Document doc = client.contentAsDocument(new HttpGet(uri.getURI()));
      for (Node node : doc.getRootNode().getChildNodes()) {
        Qname id = getObjectResourceQname(node);
        LocalizedText name = getNames(node);
        Qname rootTaxon = getRooTaxonOrNull(node);
        Qname owner = getOwnerOrNull(node);
View Full Code Here

        if (client != null) client.close();
      }
    }
    private Map<String, Person> loadUsingClient(HttpClientService client) throws Exception {
      Map<String, Person> persons = new HashMap<String, Person>();
      URIBuilder uri = new URIBuilder(config.get("TriplestoreURL") + "/search)")
      .addParameter("predicate", "rdf:type")
      .addParameter("object", "MA.person");
     
      Document doc = client.contentAsDocument(new HttpGet(uri.getURI()));
      for (Node node : doc.getRootNode().getChildNodes()) {
        String id = node.getAttribute("rdf:about").replace("http://id.luomus.fi/", "");
        String fullname = null;
        if (node.hasChildNodes("MA.fullName")) {
          fullname = node.getNode("MA.fullName").getContents();
View Full Code Here

TOP

Related Classes of fi.luomus.commons.utils.URIBuilder

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.