public class PostBuilder extends BodyRequestBuilder
client, request, targetUri| Constructor and Description |
|---|
PostBuilder(URI uri,
FcrepoClient client)
Instantiate builder
|
| Modifier and Type | Method and Description |
|---|---|
PostBuilder |
body(File file,
String contentType)
Add the given file as the body for this request with the provided content type
|
PostBuilder |
body(InputStream stream)
Add a body to this request from a stream, with application/octet-stream as its content type
|
PostBuilder |
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
|
PostBuilder |
digest(String digest)
Provide a SHA-1 checksum for the body of this request
|
PostBuilder |
filename(String filename)
Provide a content disposition header which will be used as the filename
|
PostBuilder |
slug(String slug)
Provide a suggested name for the new child resource, which the repository may ignore.
|
ifMatch, ifUnmodifiedSinceperformpublic PostBuilder(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 PostBuilder 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 PostBuilder 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 PostBuilder body(InputStream stream)
BodyRequestBuilderbody in class BodyRequestBuilderstream - InputStream of the content to be sent to the serverpublic PostBuilder digest(String digest)
BodyRequestBuilderdigest in class BodyRequestBuilderdigest - sha-1 checksum to provide as the digest for the request bodypublic PostBuilder filename(String filename) throws FcrepoOperationFailedException
filename - the name of the file being provided in the body of the requestFcrepoOperationFailedException - if unable to encode filenamepublic PostBuilder slug(String slug)
slug - value to supply as the slug headerCopyright © 2013-2016 DuraSpace, Inc.. All Rights Reserved.