public class HttpHelper
extends java.lang.Object
| Constructor and Description |
|---|
HttpHelper(java.lang.String repositoryURL,
org.apache.http.client.HttpClient httpClient,
boolean readOnly)
Create an HTTP helper with a pre-configured HttpClient instance.
|
HttpHelper(java.lang.String repositoryURL,
java.lang.String fedoraUsername,
java.lang.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(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params,
FedoraContent content)
Create a request to create/update content.
|
org.apache.http.client.methods.HttpGet |
createGetMethod(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
Create GET method with list of parameters
|
org.apache.http.client.methods.HttpHead |
createHeadMethod(java.lang.String path)
Create HEAD method
|
org.apache.http.client.methods.HttpPatch |
createPatchMethod(java.lang.String path,
java.lang.String sparqlUpdate)
Create a request to update triples with SPARQL Update.
|
org.apache.http.client.methods.HttpPost |
createPostMethod(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
Create POST method with list of parameters
|
org.apache.http.client.methods.HttpPut |
createPutMethod(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
Create PUT method with list of parameters
|
org.apache.http.client.methods.HttpPut |
createTriplesPutMethod(java.lang.String path,
java.io.InputStream updatedProperties,
java.lang.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(java.lang.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(java.lang.String repositoryURL,
java.lang.String fedoraUsername,
java.lang.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 java.io.IOException,
ReadOnlyException
java.io.IOExceptionReadOnlyExceptionpublic org.apache.http.client.methods.HttpHead createHeadMethod(java.lang.String path)
path - Resource path, relative to repository baseURLpublic org.apache.http.client.methods.HttpGet createGetMethod(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
path - Resource path, relative to repository baseURLparams - Query parameterspublic org.apache.http.client.methods.HttpPatch createPatchMethod(java.lang.String path,
java.lang.String sparqlUpdate)
throws FedoraException
path - The datastream path.sparqlUpdate - SPARQL Update command.FedoraExceptionpublic org.apache.http.client.methods.HttpPost createPostMethod(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
path - Resource path, relative to repository baseURLparams - Query parameterspublic org.apache.http.client.methods.HttpPut createPutMethod(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
path - Resource path, relative to repository baseURLparams - Query parameterspublic org.apache.http.client.methods.HttpPut createContentPutMethod(java.lang.String path,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params,
FedoraContent content)
path - The datastream path.content - Content parameters.public org.apache.http.client.methods.HttpPut createTriplesPutMethod(java.lang.String path,
java.io.InputStream updatedProperties,
java.lang.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 updateFedoraExceptionCopyright © 2013-2014 DuraSpace, Inc.. All Rights Reserved.