Package org.fcrepo.client
Class BodyRequestBuilder
- java.lang.Object
-
- org.fcrepo.client.RequestBuilder
-
- org.fcrepo.client.BodyRequestBuilder
-
- Direct Known Subclasses:
PatchBuilder,PostBuilder,PutBuilder
public abstract class BodyRequestBuilder extends RequestBuilder
Request builder which includes a body component- Author:
- bbpennel
-
-
Field Summary
-
Fields inherited from class org.fcrepo.client.RequestBuilder
client, request, targetUri
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBodyRequestBuilder(URI uri, FcrepoClient client)Instantiate builder
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected BodyRequestBuilderaddInteractionModel(String interactionModelUri)Add an interaction model to the requestprotected BodyRequestBuilderbody(File file, String contentType)Add the given file as the body for this request with the provided content typeprotected BodyRequestBuilderbody(InputStream stream)Add a body to this request from a stream, with application/octet-stream as its content typeprotected BodyRequestBuilderbody(InputStream stream, String contentType)Add a body to this request as a stream with the given content typeprotected BodyRequestBuilderdigest(String digest)Deprecated.protected BodyRequestBuilderdigest(String digest, String alg)Provide a checksum for the body of this requestprotected BodyRequestBuilderdigestMd5(String digest)Provide a MD5 checksum for the body of this requestprotected BodyRequestBuilderdigestSha1(String digest)Provide a SHA-1 checksum for the body of this request.protected BodyRequestBuilderdigestSha256(String digest)Provide a SHA-256 checksum for the body of this requestprotected BodyRequestBuilderexternalContent(URI contentURI, String contentType, String handling)Add the given URI to the request as the location a Non-RDF Source binary should use for external content.protected BodyRequestBuilderifMatch(String etag)Provide an etag for the if-match header for this requestprotected BodyRequestBuilderifStateToken(String token)Provide a value for the if-state-token header for this request.BodyRequestBuilderifUnmodifiedSince(String modified)Provide a if-unmodified-since header for this requestprotected BodyRequestBuilderlinkAcl(String aclUri)Provide the URI to an ACL for this request-
Methods inherited from class org.fcrepo.client.RequestBuilder
addHeader, addLinkHeader, createRequest, perform
-
-
-
-
Constructor Detail
-
BodyRequestBuilder
protected BodyRequestBuilder(URI uri, FcrepoClient client)
Instantiate builder- Parameters:
uri- uri request will be issued toclient- the client
-
-
Method Detail
-
body
protected BodyRequestBuilder body(InputStream stream)
Add a body to this request from a stream, with application/octet-stream as its content type- Parameters:
stream- InputStream of the content to be sent to the server- Returns:
- this builder
-
body
protected BodyRequestBuilder body(InputStream stream, String contentType)
Add a body to this request as a stream with the given content type- Parameters:
stream- InputStream of the content to be sent to the servercontentType- the Content-Type of the body- Returns:
- this builder
-
body
protected BodyRequestBuilder body(File file, String contentType) throws IOException
Add the given file as the body for this request with the provided content type- Parameters:
file- File containing the content to be sent to the servercontentType- the Content-Type of the body- Returns:
- this builder
- Throws:
IOException- when unable to stream the body file
-
externalContent
protected BodyRequestBuilder externalContent(URI contentURI, String contentType, String handling)
Add the given URI to the request as the location a Non-RDF Source binary should use for external content. The handling parameter must be supplied, and informs the server of how to process the request.- Parameters:
contentURI- URI of the external content.contentType- Mimetype to supply for the external content.handling- Name of the handling method, used by the server to determine how to process the external content URI. Standard values can be found inExternalContentHandling.- Returns:
- this builder
-
digest
@Deprecated protected BodyRequestBuilder digest(String digest)
Deprecated.Provide a SHA-1 checksum for the body of this request.- Parameters:
digest- sha-1 checksum to provide as the digest for the request body- Returns:
- this builder
-
digest
protected BodyRequestBuilder digest(String digest, String alg)
Provide a checksum for the body of this request- Parameters:
digest- checksum to provide as the digest for the request bodyalg- abbreviated algorithm identifier for the type of checksum being added (for example, sha1, md5, etc)- Returns:
- this builder
-
digestSha1
protected BodyRequestBuilder digestSha1(String digest)
Provide a SHA-1 checksum for the body of this request.- Parameters:
digest- sha-1 checksum to provide as the digest for the request body- Returns:
- this builder
-
digestMd5
protected BodyRequestBuilder digestMd5(String digest)
Provide a MD5 checksum for the body of this request- Parameters:
digest- MD5 checksum to provide as the digest for the request body- Returns:
- this builder
-
digestSha256
protected BodyRequestBuilder digestSha256(String digest)
Provide a SHA-256 checksum for the body of this request- Parameters:
digest- sha-256 checksum to provide as the digest for the request body- Returns:
- this builder
-
addInteractionModel
protected BodyRequestBuilder addInteractionModel(String interactionModelUri)
Add an interaction model to the request- Parameters:
interactionModelUri- URI of the interaction model- Returns:
- this builder
-
ifUnmodifiedSince
public BodyRequestBuilder ifUnmodifiedSince(String modified)
Provide a if-unmodified-since header for this request- Parameters:
modified- date to provide as the if-unmodified-since header- Returns:
- this builder
-
ifMatch
protected BodyRequestBuilder ifMatch(String etag)
Provide an etag for the if-match header for this request- Parameters:
etag- etag to provide as the if-match header- Returns:
- this builder
-
linkAcl
protected BodyRequestBuilder linkAcl(String aclUri)
Provide the URI to an ACL for this request- Parameters:
aclUri- URI to the ACL- Returns:
- this builder
-
ifStateToken
protected BodyRequestBuilder ifStateToken(String token)
Provide a value for the if-state-token header for this request.- Parameters:
token- state token value- Returns:
- this builder
-
-