public class PutBuilder extends BodyRequestBuilder
client, request, targetUri| Constructor and Description |
|---|
PutBuilder(URI uri,
FcrepoClient client)
Instantiate builder
|
| Modifier and Type | Method and Description |
|---|---|
PutBuilder |
body(File file,
String contentType)
Add the given file as the body for this request with the provided content type
|
PutBuilder |
body(InputStream stream)
Add a body to this request from a stream, with application/octet-stream as its content type
|
PutBuilder |
body(InputStream stream,
String contentType)
Add a body to this request as a stream with the given content type
|
protected org.apache.http.client.methods.HttpRequestBase |
createRequest()
Creates the HTTP request object for this builder
|
PutBuilder |
digest(String digest)
Deprecated.
|
PutBuilder |
digest(String digest,
String alg)
Provide a checksum for the body of this request
|
PutBuilder |
digestMd5(String digest)
Provide a MD5 checksum for the body of this request
|
PutBuilder |
digestSha1(String digest)
Provide a SHA-1 checksum for the body of this request.
|
PutBuilder |
digestSha256(String digest)
Provide a SHA-256 checksum for the body of this request
|
PutBuilder |
filename(String filename)
Provide a content disposition header which will be used as the filename
|
PutBuilder |
ifMatch(String etag)
Provide an etag for the if-match header for this request
|
PutBuilder |
ifUnmodifiedSince(String modified)
Provide a if-unmodified-since header for this request
|
BodyRequestBuilder |
preferLenient()
Set the prefer header for this request to lenient handling, to indicate that server-managed triples will not
be included in the request body.
|
performpublic PutBuilder(URI uri, FcrepoClient client)
uri - uri of the resource this request is being made toclient - the clientprotected org.apache.http.client.methods.HttpRequestBase createRequest()
RequestBuildercreateRequest in class RequestBuilderpublic PutBuilder body(InputStream stream, String contentType)
BodyRequestBuilderbody in class BodyRequestBuilderstream - InputStream of the content to be sent to the servercontentType - the Content-Type of the bodypublic PutBuilder body(File file, String contentType) throws IOException
BodyRequestBuilderbody in class BodyRequestBuilderfile - File containing the content to be sent to the servercontentType - the Content-Type of the bodyIOException - when unable to stream the body filepublic PutBuilder body(InputStream stream)
BodyRequestBuilderbody in class BodyRequestBuilderstream - InputStream of the content to be sent to the serverpublic PutBuilder ifMatch(String etag)
BodyRequestBuilderifMatch in class BodyRequestBuilderetag - etag to provide as the if-match headerpublic PutBuilder ifUnmodifiedSince(String modified)
BodyRequestBuilderifUnmodifiedSince in class BodyRequestBuildermodified - date to provide as the if-unmodified-since header@Deprecated public PutBuilder digest(String digest)
BodyRequestBuilderdigest in class BodyRequestBuilderdigest - sha-1 checksum to provide as the digest for the request bodypublic PutBuilder digest(String digest, String alg)
BodyRequestBuilderdigest in class BodyRequestBuilderdigest - 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)public PutBuilder digestMd5(String digest)
BodyRequestBuilderdigestMd5 in class BodyRequestBuilderdigest - MD5 checksum to provide as the digest for the request bodypublic PutBuilder digestSha1(String digest)
BodyRequestBuilderdigestSha1 in class BodyRequestBuilderdigest - sha-1 checksum to provide as the digest for the request bodypublic PutBuilder digestSha256(String digest)
BodyRequestBuilderdigestSha256 in class BodyRequestBuilderdigest - sha-256 checksum to provide as the digest for the request bodypublic PutBuilder filename(String filename) throws FcrepoOperationFailedException
filename - the name of the file being provided in the body of the requestFcrepoOperationFailedException - if unable to encode filenamepublic BodyRequestBuilder preferLenient()
Copyright © 2013–2017 DuraSpace, Inc.. All rights reserved.