use of org.eclipse.rdf4j.repository.RepositoryException in project rdf4j by eclipse.
the class RDF4JProtocolSession method getRepositoryList.
public void getRepositoryList(TupleQueryResultHandler handler) throws IOException, TupleQueryResultHandlerException, RepositoryException, UnauthorizedException, QueryInterruptedException {
checkServerURL();
HttpGet method = new HttpGet(Protocol.getRepositoriesLocation(serverURL));
try {
getTupleQueryResult(method, handler);
} catch (MalformedQueryException e) {
// This shouldn't happen as no queries are involved
logger.warn("Server reported unexpected malfored query error", e);
throw new RepositoryException(e.getMessage(), e);
} finally {
method.reset();
}
}
use of org.eclipse.rdf4j.repository.RepositoryException in project rdf4j by eclipse.
the class RDF4JProtocolSession method getContextIDs.
public void getContextIDs(TupleQueryResultHandler handler) throws IOException, TupleQueryResultHandlerException, RepositoryException, UnauthorizedException, QueryInterruptedException {
checkRepositoryURL();
HttpGet method = new HttpGet(Protocol.getContextsLocation(getQueryURL()));
try {
getTupleQueryResult(method, handler);
} catch (MalformedQueryException e) {
logger.warn("Server reported unexpected malfored query error", e);
throw new RepositoryException(e.getMessage(), e);
} finally {
method.reset();
}
}
use of org.eclipse.rdf4j.repository.RepositoryException in project rdf4j by eclipse.
the class RDF4JProtocolSession method removeNamespacePrefix.
public void removeNamespacePrefix(String prefix) throws IOException, RepositoryException, UnauthorizedException {
checkRepositoryURL();
HttpDelete method = new HttpDelete(Protocol.getNamespacePrefixLocation(getQueryURL(), prefix));
try {
executeNoContent(method);
} catch (RepositoryException e) {
throw e;
} catch (RDF4JException e) {
throw new RepositoryException(e);
} finally {
method.reset();
}
}
use of org.eclipse.rdf4j.repository.RepositoryException in project rdf4j by eclipse.
the class RDF4JProtocolSession method getNamespace.
public String getNamespace(String prefix) throws IOException, RepositoryException, UnauthorizedException {
checkRepositoryURL();
HttpGet method = new HttpGet(Protocol.getNamespacePrefixLocation(getQueryURL(), prefix));
try {
HttpResponse response = execute(method);
int code = response.getStatusLine().getStatusCode();
if (code == HttpURLConnection.HTTP_OK || code == HttpURLConnection.HTTP_NOT_AUTHORITATIVE) {
return EntityUtils.toString(response.getEntity());
} else {
EntityUtils.consume(response.getEntity());
return null;
}
} catch (RepositoryException e) {
throw e;
} catch (RDF4JException e) {
throw new RepositoryException(e);
} finally {
method.reset();
}
}
use of org.eclipse.rdf4j.repository.RepositoryException in project rdf4j by eclipse.
the class RDF4JProtocolSession method clearNamespaces.
public void clearNamespaces() throws IOException, RepositoryException, UnauthorizedException {
checkRepositoryURL();
HttpDelete method = new HttpDelete(Protocol.getNamespacesLocation(getQueryURL()));
try {
executeNoContent(method);
} catch (RepositoryException e) {
throw e;
} catch (RDF4JException e) {
throw new RepositoryException(e);
} finally {
method.reset();
}
}
Aggregations