public class HttpHelper extends Object
| Constructor and Description |
|---|
HttpHelper(String repositoryURL,
org.apache.http.client.HttpClient httpClient,
boolean readOnly)
Create an HTTP helper with a pre-configured HttpClient instance.
|
HttpHelper(String repositoryURL,
String fedoraUsername,
String fedoraPassword,
boolean readOnly)
Create an HTTP helper for the specified repository.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.client.methods.HttpPut |
createContentPutMethod(String path,
Map<String,List<String>> params,
FedoraContent content)
Create a request to create/update content.
|
HttpCopy |
createCopyMethod(String sourcePath,
String destinationPath)
Create COPY method
|
org.apache.http.client.methods.HttpDelete |
createDeleteMethod(String path)
Create DELETE method
|
org.apache.http.client.methods.HttpGet |
createGetMethod(String path,
Map<String,List<String>> params)
Create GET method with list of parameters
|
org.apache.http.client.methods.HttpHead |
createHeadMethod(String path)
Create HEAD method
|
HttpMove |
createMoveMethod(String sourcePath,
String destinationPath)
Create MOVE method
|
org.apache.http.client.methods.HttpPatch |
createPatchMethod(String path,
String sparqlUpdate)
Create a request to update triples with SPARQL Update.
|
org.apache.http.client.methods.HttpPost |
createPostMethod(String path,
Map<String,List<String>> params)
Create POST method with list of parameters
|
org.apache.http.client.methods.HttpPut |
createPutMethod(String path,
Map<String,List<String>> params)
Create PUT method with list of parameters
|
org.apache.http.client.methods.HttpPut |
createTriplesPutMethod(String path,
InputStream updatedProperties,
String contentType)
Create a request to update triples.
|
org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest request)
Execute a request for a subclass.
|
FedoraResourceImpl |
loadProperties(FedoraResourceImpl resource)
Retrieve RDF from the repository and update the properties of a resource
|
public HttpHelper(String repositoryURL, org.apache.http.client.HttpClient httpClient, boolean readOnly)
repositoryURL - Fedora base URL.httpClient - Pre-configured HttpClient instance.readOnly - If true, throw an exception when an update is attempted.public HttpHelper(String repositoryURL, String fedoraUsername, String fedoraPassword, boolean readOnly)
repositoryURL - Fedora base URL.fedoraUsername - Fedora usernamefedoraPassword - Fedora passwordreadOnly - If true, throw an exception when an update is attempted.public org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest request)
throws IOException,
ReadOnlyException
request - request to be executedIOExceptionReadOnlyExceptionpublic org.apache.http.client.methods.HttpHead createHeadMethod(String path)
path - Resource path, relative to repository baseURLpublic org.apache.http.client.methods.HttpGet createGetMethod(String path, Map<String,List<String>> params)
path - Resource path, relative to repository baseURLparams - Query parameterspublic org.apache.http.client.methods.HttpDelete createDeleteMethod(String path)
path - Resource path, relative to repository baseURLpublic org.apache.http.client.methods.HttpPatch createPatchMethod(String path, String sparqlUpdate) throws FedoraException
path - The datastream path.sparqlUpdate - SPARQL Update command.FedoraExceptionpublic org.apache.http.client.methods.HttpPost createPostMethod(String path, Map<String,List<String>> params)
path - Resource path, relative to repository baseURLparams - Query parameterspublic org.apache.http.client.methods.HttpPut createPutMethod(String path, Map<String,List<String>> params)
path - Resource path, relative to repository baseURLparams - Query parameterspublic org.apache.http.client.methods.HttpPut createContentPutMethod(String path, Map<String,List<String>> params, FedoraContent content)
path - The datastream path.params - Mapping of parameters for the PUT requestcontent - Content parameters.public org.apache.http.client.methods.HttpPut createTriplesPutMethod(String path, InputStream updatedProperties, String contentType) throws FedoraException
path - The datastream path.updatedProperties - InputStream containing RDF.contentType - Content type of the RDF in updatedProperties (e.g., "text/rdf+n3" or
"application/rdf+xml").FedoraExceptionpublic FedoraResourceImpl loadProperties(FedoraResourceImpl resource) throws FedoraException
resource - The resource to updateFedoraExceptionpublic HttpCopy createCopyMethod(String sourcePath, String destinationPath)
sourcePath - Source path, relative to repository baseURLdestinationPath - Destination path, relative to repository baseURLCopyright © 2013-2015 DuraSpace, Inc.. All Rights Reserved.