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)
Deprecated.
the COPY method is not supported by the Fedora 1.0 specification
|
OriginalMementoBuilder |
createMemento(URI url)
Make a POST request to create a new memento (LDPRm) within an LDPCv of the current version of a resource.
|
HistoricMementoBuilder |
createMemento(URI url,
Instant mementoInstant)
Make a POST request to create a new memento (LDPRm) within an LDPCv using the given memento-datetime and the
request body.
|
HistoricMementoBuilder |
createMemento(URI url,
String mementoDatetime)
Make a POST request to create a new memento (LDPRm) within an LDPCv using the given memento-datetime and the
request body.
|
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)
Deprecated.
the MOVE method is not supported by the Fedora 1.0 specification
|
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)
url - the URL of the resource to which to PUTpublic PatchBuilder patch(URI url)
url - the URL of the resource to which to PATCHpublic PostBuilder post(URI url)
url - the URL of the resource to which to POSTpublic OriginalMementoBuilder createMemento(URI url)
url - the URL of the LDPCv in which to create the LDPRm.public HistoricMementoBuilder createMemento(URI url, Instant mementoInstant)
url - the URL of the LDPCv in which to create the LDPRm.mementoInstant - the memento datetime as an Instant.public HistoricMementoBuilder createMemento(URI url, String mementoDatetime)
url - the URL of the LDPCv in which to create the LDPRm.mementoDatetime - the RFC1123 formatted memento datetime.public DeleteBuilder delete(URI url)
url - the URL of the resource to which to DELETE@Deprecated public CopyBuilder copy(URI source, URI destination)
source - url of the resource to copydestination - url of the location for the copy@Deprecated public MoveBuilder move(URI source, URI destination)
source - url of the resource to movedestination - url of the new location for the resourcepublic GetBuilder get(URI url)
url - the URL of the resource to which to GETpublic HeadBuilder head(URI url)
url - the URL of the resource to make the HEAD request on.public OptionsBuilder options(URI url)
url - the URL of the resource to make the OPTIONS request on.public 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–2019 DuraSpace, Inc.. All rights reserved.