Package org.fcrepo.client
Class GetBuilder
- java.lang.Object
-
- org.fcrepo.client.RequestBuilder
-
- org.fcrepo.client.RetrieveRequestBuilder
-
- org.fcrepo.client.GetBuilder
-
public class GetBuilder extends RetrieveRequestBuilder
Builds a GET request to retrieve the content of a resource from the Fedora HTTP API- Author:
- bbpennel
-
-
Field Summary
-
Fields inherited from class org.fcrepo.client.RequestBuilder
client, request, targetUri
-
-
Constructor Summary
Constructors Constructor Description GetBuilder(URI uri, FcrepoClient client)Construct a GetBuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetBuilderaccept(String mediaType)Add the accept header to this request to negotiate the response format.GetBuilderacceptDatetime(String acceptDatetime)Provide an Accept-Datetime from the given RFC1123 formatted string.GetBuilderacceptDatetime(Instant acceptInstant)Provide an Accept-Datetime header in RFC1123 format from the given instant for memento datetime negotiation.GetBuilderaddHeader(String name, String value)Add a header with the given name and value to the request.GetBuilderaddLinkHeader(FcrepoLink linkHeader)Add a link header to the requestprotected org.apache.http.client.methods.HttpRequestBasecreateRequest()Creates the HTTP request object for this builderGetBuilderdisableRedirects()Disable following redirects.GetBuilderifModifiedSince(String lastModified)Provide a if-last-modified header for this requestGetBuilderifNoneMatch(String etag)Provide an etag for the if-none-match header for this requestGetBuildernoCache()Provide a Cache-Control header with value "no-cache"GetBuilderpreferRepresentation()Set the prefer header for this request to representation, to indicate that links to other resources and their properties should also be included.GetBuilderpreferRepresentation(List<URI> includeUris, List<URI> omitUris)Set the prefer header for this request to representation, to indicate that links to other resources and their properties should also be included.GetBuilderrange(Long rangeStart, Long rangeEnd)Set the byte range of content to retrieveGetBuilderwantDigest(String value)Provide a Want-Digest header for this request-
Methods inherited from class org.fcrepo.client.RequestBuilder
perform
-
-
-
-
Constructor Detail
-
GetBuilder
public GetBuilder(URI uri, FcrepoClient client)
Construct a GetBuilder- Parameters:
uri- the targetclient- the client for this request
-
-
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
-
accept
public GetBuilder accept(String mediaType)
Add the accept header to this request to negotiate the response format.- Parameters:
mediaType- media type to set as the accept header. It should be a value from one of the allowed RDF source formats supported by Fedora.- Returns:
- this builder
-
range
public GetBuilder range(Long rangeStart, Long rangeEnd)
Set the byte range of content to retrieve- Parameters:
rangeStart- beginning byte indexrangeEnd- ending byte index- Returns:
- this builder
-
preferRepresentation
public GetBuilder preferRepresentation()
Set the prefer header for this request to representation, to indicate that links to other resources and their properties should also be included.- Returns:
- this builder
-
preferRepresentation
public GetBuilder preferRepresentation(List<URI> includeUris, List<URI> omitUris)
Set the prefer header for this request to representation, to indicate that links to other resources and their properties should also be included. The set of properties returned can be further specified by providing lists of LDP defined preferences to omit or include.- Parameters:
includeUris- URIs of LDP defined preferences to includeomitUris- URIs of LDP defined preferences to omit- Returns:
- this builder
-
ifNoneMatch
public GetBuilder ifNoneMatch(String etag)
Provide an etag for the if-none-match header for this request- Parameters:
etag- etag to provide as the if-none-match header- Returns:
- this builder
-
ifModifiedSince
public GetBuilder ifModifiedSince(String lastModified)
Provide a if-last-modified header for this request- Parameters:
lastModified- date to provided as the if-modified-since header- Returns:
- this builder
-
disableRedirects
public GetBuilder disableRedirects()
Description copied from class:RetrieveRequestBuilderDisable following redirects.- Overrides:
disableRedirectsin classRetrieveRequestBuilder- Returns:
- this builder
-
wantDigest
public GetBuilder wantDigest(String value)
Description copied from class:RetrieveRequestBuilderProvide a Want-Digest header for this request- Overrides:
wantDigestin classRetrieveRequestBuilder- Parameters:
value- header value, following the syntax defined in: https://tools.ietf.org/html/rfc3230#section-4.3.1- Returns:
- this builder
-
noCache
public GetBuilder noCache()
Description copied from class:RetrieveRequestBuilderProvide a Cache-Control header with value "no-cache"- Overrides:
noCachein classRetrieveRequestBuilder- Returns:
- this builder
-
acceptDatetime
public GetBuilder acceptDatetime(Instant acceptInstant)
Description copied from class:RetrieveRequestBuilderProvide an Accept-Datetime header in RFC1123 format from the given instant for memento datetime negotiation.- Overrides:
acceptDatetimein classRetrieveRequestBuilder- Parameters:
acceptInstant- the accept datetime represented as an Instant.- Returns:
- this builder
-
acceptDatetime
public GetBuilder acceptDatetime(String acceptDatetime)
Description copied from class:RetrieveRequestBuilderProvide an Accept-Datetime from the given RFC1123 formatted string.- Overrides:
acceptDatetimein classRetrieveRequestBuilder- Parameters:
acceptDatetime- the accept datetime as a string, must be in RFC1123 format.- Returns:
- this builder
-
addHeader
public GetBuilder 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 GetBuilder 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
-
-