Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpGet.releaseConnection()


        } catch(IllegalStateException e) {
            throw new MarmottaClientException("error evaluating SPARQL Select Query ", e);
        } catch(QueryResultHandlerException e) {
            throw new MarmottaClientException("error evaluating SPARQL Select Query ", e);
        } finally {
            get.releaseConnection();
        }
    }

    /**
     * Carry out a SPARQL ASK Query and return either true or false, depending on the query result.
View Full Code Here


        } catch(IllegalStateException e) {
            throw new MarmottaClientException("error evaluating SPARQL Ask Query ", e);
        } catch(QueryResultHandlerException e) {
            throw new MarmottaClientException("error evaluating SPARQL Ask Query ", e);
        } finally {
            get.releaseConnection();
        }
    }

    /**
     * Execute a SPARQL Update query according to the SPARQL 1.1 standard. The query will only be passed to the server,
View Full Code Here

                    log.error("error evaluating SPARQL UPDATE Query {}: {} {}",new Object[] {updateQuery,response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error evaluating SPARQL UPDATE Query "+updateQuery +": "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            get.releaseConnection();
        }
    }
   
    /**
     * FIXME: Replace this with QueryResultIO.parse after Sesame-2.7.3.
View Full Code Here

                    handler.requestUrl = requestUri;
                    handler.language   = lang;
                    client.getClient().execute(get, handler);
                } finally {
                    get.releaseConnection();
                }
            }

            Date expiresDate = handler.expiresDate;
            if (expiresDate == null) {
View Full Code Here

                    log.error("error retrieving list of import types: {} {}",new Object[] {response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error retrieving list of import types: "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            get.releaseConnection();
        }
    }

    /**
     * Upload/Import a dataset in the Marmotta Server. The dataset is given as an Inputstream that contains data of the
View Full Code Here

                    log.error("error evaluating LDPath Path Query {}: {} {}",new Object[] {path,response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error evaluating LDPath Path Query "+path+": "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            get.releaseConnection();
        }

    }
   
   
View Full Code Here

                    log.error("error evaluating LDPath Program Query: {} {}",new Object[] {response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error evaluating LDPath Program Query: "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            get.releaseConnection();
        }
    }

}
View Full Code Here

        } catch (UnsupportedEncodingException e) {
            log.error("could not encode URI parameter",e);
            throw new MarmottaClientException("could not encode URI parameter");
        } finally {
            get.releaseConnection();
        }
    }

    /**
     * Update (overwrite) the metadata of the resource identified by the given uri. The metadata will be serialised to
View Full Code Here

        } catch (UnsupportedEncodingException e) {
            log.error("could not encode URI parameter",e);
            throw new MarmottaClientException("could not encode URI parameter");
        } finally {
            get.releaseConnection();
        }
    }

    /**
     * Update the content of the resource identified by the URI given as argument. The resource has to exist before
View Full Code Here

                    + " " + readString(rsp.getEntity().getContent(), "UTF-8"));
        } catch (Exception ex) {
            throw new RuntimeException("Problem while " + http.getMethod()
                    + ", Error:" + ex.getMessage() + ", url:" + url, ex);
        } finally {
            http.releaseConnection();
        }
    }

    private void addHeaders(HttpRequestBase http) {
        http.setHeader("Content-Type", "application/json; charset=utf-8");
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.