public class FcrepoClient extends Object
Users of the FcrepoClient are responsible for managing connection resources. Specifically, the underlying
HTTP connections of this client must be freed. Suggested usage is to create the FcrepoResponse within a
try-with-resources block, insuring that any resources held by the response are freed automatically.
FcrepoClient client = ...;
try (FcrepoResponse res = client.get(...).perform()) {
// do something with the response
} catch (FcrepoOperationFailedException|IOException e) {
// handle any exceptions
}
| Modifier and Type | Class and Description |
|---|---|
static class |
FcrepoClient.FcrepoClientBuilder
Builds an FcrepoClient
|
| Modifier | Constructor and Description |
|---|---|
protected |
FcrepoClient(String username,
String password,
String host,
Boolean throwExceptionOnFailure)
Create a FcrepoClient with a set of authentication values.
|
| Modifier and Type | Method and Description |
|---|---|
static FcrepoClient.FcrepoClientBuilder |
client()
Build a FcrepoClient
|
CopyBuilder |
copy(URI source,
URI destination)
Make a MOVE request to copy a resource (and its subtree) to a new location.
|
DeleteBuilder |
delete(URI url)
Make a DELETE request to delete a resource
|
FcrepoResponse |
executeRequest(URI url,
org.apache.http.client.methods.HttpRequestBase request)
Execute a HTTP request
|
GetBuilder |
get(URI url)
Make a GET request to retrieve the content of a resource
|
HeadBuilder |
head(URI url)
Make a HEAD request to retrieve resource headers.
|
MoveBuilder |
move(URI source,
URI destination)
Make a COPY request to move a resource (and its subtree) to a new location.
|
OptionsBuilder |
options(URI url)
Make a OPTIONS request to output information about the supported HTTP methods, etc.
|
PatchBuilder |
patch(URI url)
Make a PATCH request to modify the triples associated with a resource with SPARQL-Update.
|
PostBuilder |
post(URI url)
Make a POST request to create a new resource within an LDP container.
|
PutBuilder |
put(URI url)
Make a PUT request to create a resource with a specified path, or replace the triples associated with a
resource with the triples provided in the request body.
|
protected FcrepoClient(String username, String password, String host, Boolean throwExceptionOnFailure)
username - the username for the repositorypassword - the password for the repositoryhost - the authentication hostname (realm) for the repositorythrowExceptionOnFailure - whether to throw an exception on any non-2xx or 3xx HTTP responsespublic static FcrepoClient.FcrepoClientBuilder client()
public PutBuilder put(URI url) throws FcrepoOperationFailedException
url - the URL of the resource to which to PUTFcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic PatchBuilder patch(URI url) throws FcrepoOperationFailedException
url - the URL of the resource to which to PATCHFcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic PostBuilder post(URI url) throws FcrepoOperationFailedException
url - the URL of the resource to which to POSTFcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic DeleteBuilder delete(URI url) throws FcrepoOperationFailedException
url - the URL of the resource to which to DELETEFcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic CopyBuilder copy(URI source, URI destination) throws FcrepoOperationFailedException
source - url of the resource to copydestination - url of the location for the copyFcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic MoveBuilder move(URI source, URI destination) throws FcrepoOperationFailedException
source - url of the resource to movedestination - url of the new location for the resourceFcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic GetBuilder get(URI url) throws FcrepoOperationFailedException
url - the URL of the resource to which to GETFcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic HeadBuilder head(URI url) throws FcrepoOperationFailedException
url - the URL of the resource to make the HEAD request on.FcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic OptionsBuilder options(URI url) throws FcrepoOperationFailedException
url - the URL of the resource to make the OPTIONS request on.FcrepoOperationFailedException - when the underlying HTTP request results in an errorpublic FcrepoResponse executeRequest(URI url, org.apache.http.client.methods.HttpRequestBase request) throws FcrepoOperationFailedException
url - URI the request is made torequest - the requestFcrepoOperationFailedException - when the underlying HTTP request results in an errorCopyright © 2013-2016 DuraSpace, Inc.. All Rights Reserved.