Package org.openrdf.http.client

Examples of org.openrdf.http.client.HTTPClient


    throws RepositoryException
  {
    List<RepositoryInfo> result = new ArrayList<RepositoryInfo>();

    try {
      HTTPClient httpClient = new HTTPClient();
      httpClient.setServerURL(serverURL);
      httpClient.setUsernameAndPassword(username, password);

      TupleQueryResult responseFromServer = httpClient.getRepositoryList();
      while (responseFromServer.hasNext()) {
        BindingSet bindingSet = responseFromServer.next();
        RepositoryInfo repInfo = new RepositoryInfo();

        String id = LiteralUtil.getLabel(bindingSet.getValue("id"), null);
View Full Code Here


  }

  public GraphQueryResult evaluate()
    throws HTTPQueryEvaluationException
  {
    HTTPClient client = httpCon.getRepository().getHTTPClient();

    try {
      return client.sendGraphQuery(queryLanguage, queryString, dataset, includeInferred, getBindingsArray());
    }
    catch (IOException e) {
      throw new HTTPQueryEvaluationException(e.getMessage(), e);
    }
    catch (RepositoryException e) {
View Full Code Here

  }

  public void evaluate(RDFHandler handler)
    throws HTTPQueryEvaluationException, RDFHandlerException
  {
    HTTPClient client = httpCon.getRepository().getHTTPClient();
    try {
      client.sendGraphQuery(queryLanguage, queryString, dataset, includeInferred, handler);
    }
    catch (IOException e) {
      throw new HTTPQueryEvaluationException(e.getMessage(), e);
    }
    catch (RepositoryException e) {
View Full Code Here

  }

  private boolean connectRemote(String url) {
    try {
      // Ping server
      HTTPClient httpClient = new HTTPClient();
      httpClient.setServerURL(url);
      httpClient.getServerProtocol();

      return installNewManager(new RemoteRepositoryManager(url), url);
    }
    catch (UnauthorizedException e) {
      // FIXME: handle authentication
View Full Code Here

      Resource... contexts)
    throws IOException, RDFParseException, RepositoryException
  {
    if (isAutoCommit()) {
      // Send bytes directly to the server
      HTTPClient httpClient = getRepository().getHTTPClient();
      if (inputStreamOrReader instanceof InputStream) {
        httpClient.upload(((InputStream)inputStreamOrReader), baseURI, dataFormat, false, contexts);
      }
      else if (inputStreamOrReader instanceof Reader) {
        httpClient.upload(((Reader)inputStreamOrReader), baseURI, dataFormat, false, contexts);
      }
      else {
        throw new IllegalArgumentException(
            "inputStreamOrReader must be an InputStream or a Reader, is a: "
                + inputStreamOrReader.getClass());
View Full Code Here

  }

  public boolean evaluate()
    throws HTTPQueryEvaluationException
  {
    HTTPClient client = httpCon.getRepository().getHTTPClient();

    try {
      return client.sendBooleanQuery(queryLanguage, queryString, dataset, includeInferred, getBindingsArray());
    }
    catch (IOException e) {
      throw new HTTPQueryEvaluationException(e.getMessage(), e);
    }
    catch (RepositoryException e) {
View Full Code Here

  }

  public TupleQueryResult evaluate()
    throws HTTPQueryEvaluationException
  {
    HTTPClient client = httpCon.getRepository().getHTTPClient();

    try {
      return client.sendTupleQuery(queryLanguage, queryString, dataset, includeInferred, getBindingsArray());
    }
    catch (IOException e) {
      throw new HTTPQueryEvaluationException(e.getMessage(), e);
    }
    catch (RepositoryException e) {
View Full Code Here

  }

  public void evaluate(TupleQueryResultHandler handler)
    throws QueryEvaluationException, TupleQueryResultHandlerException
  {
    HTTPClient client = httpCon.getRepository().getHTTPClient();
    try {
      client.sendTupleQuery(queryLanguage, queryString, dataset, includeInferred, handler);
    }
    catch (IOException e) {
      throw new HTTPQueryEvaluationException(e.getMessage(), e);
    }
    catch (RepositoryException e) {
View Full Code Here

  /*--------------*
   * Constructors *
   *--------------*/

  private HTTPRepository() {
    httpClient = new HTTPClient();
    httpClient.setValueFactory(new ValueFactoryImpl());
  }
View Full Code Here

TOP

Related Classes of org.openrdf.http.client.HTTPClient

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.