Package org.fcrepo.client
Class PatchBuilder
- java.lang.Object
-
- org.fcrepo.client.RequestBuilder
-
- org.fcrepo.client.BodyRequestBuilder
-
- org.fcrepo.client.PatchBuilder
-
public class PatchBuilder extends BodyRequestBuilder
Builds a PUT request for interacting with the Fedora HTTP API in order to modify the triples associated with a resource with SPARQL-Update.- Author:
- bbpennel
-
-
Field Summary
-
Fields inherited from class org.fcrepo.client.RequestBuilder
client, request, targetUri
-
-
Constructor Summary
Constructors Constructor Description PatchBuilder(URI uri, FcrepoClient client)Instantiate builder
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PatchBuilderaddHeader(String name, String value)Add a header with the given name and value to the request.PatchBuilderaddLinkHeader(FcrepoLink linkHeader)Add a link header to the requestPatchBuilderbody(InputStream stream)Add a body to this request from a stream, with application/sparql-update as its content typePatchBuilderbody(InputStream stream, String contentType)Add a body to this request as a stream with the given content typeprotected org.apache.http.client.methods.HttpRequestBasecreateRequest()Creates the HTTP request object for this builderPatchBuilderdigest(String digest)Deprecated.PatchBuilderdigest(String digest, String alg)Provide a checksum for the body of this requestPatchBuilderdigestMd5(String digest)Provide a MD5 checksum for the body of this requestPatchBuilderdigestSha1(String digest)Provide a SHA-1 checksum for the body of this request.PatchBuilderdigestSha256(String digest)Provide a SHA-256 checksum for the body of this requestPatchBuilderifMatch(String etag)Provide an etag for the if-match header for this requestPatchBuilderifStateToken(String token)Provide a value for the if-state-token header for this request.PatchBuilderifUnmodifiedSince(String modified)Provide a if-unmodified-since header for this request-
Methods inherited from class org.fcrepo.client.BodyRequestBuilder
addInteractionModel, body, externalContent, linkAcl
-
Methods inherited from class org.fcrepo.client.RequestBuilder
perform
-
-
-
-
Constructor Detail
-
PatchBuilder
public PatchBuilder(URI uri, FcrepoClient client)
Instantiate builder- Parameters:
uri- uri of the resource this request is being made toclient- the client
-
-
Method Detail
-
createRequest
protected org.apache.http.client.methods.HttpRequestBase createRequest()
Description copied from class:RequestBuilderCreates the HTTP request object for this builder- Specified by:
createRequestin classRequestBuilder- Returns:
- HTTP request object for this builder
-
body
public PatchBuilder body(InputStream stream)
Add a body to this request from a stream, with application/sparql-update as its content type- Overrides:
bodyin classBodyRequestBuilder- Parameters:
stream- InputStream of the content to be sent to the server- Returns:
- this builder
-
body
public PatchBuilder body(InputStream stream, String contentType)
Description copied from class:BodyRequestBuilderAdd a body to this request as a stream with the given content type- Overrides:
bodyin classBodyRequestBuilder- Parameters:
stream- InputStream of the content to be sent to the servercontentType- the Content-Type of the body- Returns:
- this builder
-
ifMatch
public PatchBuilder ifMatch(String etag)
Description copied from class:BodyRequestBuilderProvide an etag for the if-match header for this request- Overrides:
ifMatchin classBodyRequestBuilder- Parameters:
etag- etag to provide as the if-match header- Returns:
- this builder
-
ifUnmodifiedSince
public PatchBuilder ifUnmodifiedSince(String modified)
Description copied from class:BodyRequestBuilderProvide a if-unmodified-since header for this request- Overrides:
ifUnmodifiedSincein classBodyRequestBuilder- Parameters:
modified- date to provide as the if-unmodified-since header- Returns:
- this builder
-
ifStateToken
public PatchBuilder ifStateToken(String token)
Description copied from class:BodyRequestBuilderProvide a value for the if-state-token header for this request.- Overrides:
ifStateTokenin classBodyRequestBuilder- Parameters:
token- state token value- Returns:
- this builder
-
digest
@Deprecated public PatchBuilder digest(String digest)
Deprecated.Description copied from class:BodyRequestBuilderProvide a SHA-1 checksum for the body of this request.- Overrides:
digestin classBodyRequestBuilder- Parameters:
digest- sha-1 checksum to provide as the digest for the request body- Returns:
- this builder
-
digest
public PatchBuilder digest(String digest, String alg)
Description copied from class:BodyRequestBuilderProvide a checksum for the body of this request- Overrides:
digestin classBodyRequestBuilder- 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
-
digestMd5
public PatchBuilder digestMd5(String digest)
Description copied from class:BodyRequestBuilderProvide a MD5 checksum for the body of this request- Overrides:
digestMd5in classBodyRequestBuilder- Parameters:
digest- MD5 checksum to provide as the digest for the request body- Returns:
- this builder
-
digestSha1
public PatchBuilder digestSha1(String digest)
Description copied from class:BodyRequestBuilderProvide a SHA-1 checksum for the body of this request.- Overrides:
digestSha1in classBodyRequestBuilder- Parameters:
digest- sha-1 checksum to provide as the digest for the request body- Returns:
- this builder
-
digestSha256
public PatchBuilder digestSha256(String digest)
Description copied from class:BodyRequestBuilderProvide a SHA-256 checksum for the body of this request- Overrides:
digestSha256in classBodyRequestBuilder- Parameters:
digest- sha-256 checksum to provide as the digest for the request body- Returns:
- this builder
-
addHeader
public PatchBuilder addHeader(String name, String value)
Description copied from class:RequestBuilderAdd a header with the given name and value to the request.- Overrides:
addHeaderin classRequestBuilder- Parameters:
name- name of the headervalue- value of the header- Returns:
- this builder
-
addLinkHeader
public PatchBuilder addLinkHeader(FcrepoLink linkHeader)
Description copied from class:RequestBuilderAdd a link header to the request- Overrides:
addLinkHeaderin classRequestBuilder- Parameters:
linkHeader- link header value represented as a FcrepoLink- Returns:
- this builder
-
-