Package org.jclouds.http.options
Class GetOptions
- java.lang.Object
-
- org.jclouds.http.options.BaseHttpRequestOptions
-
- org.jclouds.http.options.GetOptions
-
- All Implemented Interfaces:
HttpRequestOptions
- Direct Known Subclasses:
GetObjectOptions
public class GetOptions extends BaseHttpRequestOptions
Contains options supported for HTTP GET operations.Usage
The recommended way to instantiate a GetObjectOptions object is to statically import GetObjectOptions.Builder.* and invoke a static creation method followed by an instance mutator (if needed):import static org.jclouds.http.options.GetOptions.Builder.* // this will get the first megabyte of an object. blob = client.get("objectName",range(0,1024));
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGetOptions.Builder
-
Field Summary
Fields Modifier and Type Field Description static GetOptionsNONE-
Fields inherited from class org.jclouds.http.options.BaseHttpRequestOptions
formParameters, headers, pathSuffix, payload, queryParameters
-
-
Constructor Summary
Constructors Constructor Description GetOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.Multimap<String,String>buildRequestHeaders()Builds headers representing options.booleanequals(Object obj)StringgetIfMatch()For use in the request header: If-MatchStringgetIfModifiedSince()For use in the header If-Modified-SinceStringgetIfNoneMatch()For use in the request header: If-None-MatchStringgetIfUnmodifiedSince()For use in the header If-Unmodified-SinceStringgetRange()For use in the header RangeList<String>getRanges()inthashCode()GetOptionsifETagDoesntMatch(String eTag)The object should not have a eTag hash corresponding with the parametereTag.GetOptionsifETagMatches(String eTag)The object's eTag hash should match the parametereTag.GetOptionsifModifiedSince(Date ifModifiedSince)Only return the object if it has changed since this time.GetOptionsifUnmodifiedSince(Date ifUnmodifiedSince)Only return the object if it hasn't changed since this time.GetOptionsrange(long start, long end)download the specified range of the object.GetOptionsstartAt(long start)download the object offset atstartGetOptionstail(long count)download the lastcountbytes of the objectStringtoString()-
Methods inherited from class org.jclouds.http.options.BaseHttpRequestOptions
buildFormParameters, buildPathSuffix, buildQueryParameters, buildStringPayload, getFirstFormOrNull, getFirstHeaderOrNull, getFirstQueryOrNull, replaceHeader
-
-
-
-
Field Detail
-
NONE
public static final GetOptions NONE
-
-
Method Detail
-
buildRequestHeaders
public com.google.common.collect.Multimap<String,String> buildRequestHeaders()
Description copied from class:BaseHttpRequestOptionsBuilds headers representing options.- Specified by:
buildRequestHeadersin interfaceHttpRequestOptions- Overrides:
buildRequestHeadersin classBaseHttpRequestOptions- Returns:
- multimap that may contain headers.
-
range
public GetOptions range(long start, long end)
download the specified range of the object.
-
startAt
public GetOptions startAt(long start)
download the object offset atstart
-
tail
public GetOptions tail(long count)
download the lastcountbytes of the object
-
getRange
public String getRange()
For use in the header Range- See Also:
range(long, long)
-
ifModifiedSince
public GetOptions ifModifiedSince(Date ifModifiedSince)
Only return the object if it has changed since this time. Not compatible withifETagMatches(String)orifUnmodifiedSince(Date)
-
getIfModifiedSince
public String getIfModifiedSince()
For use in the header If-Modified-Since Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).- See Also:
ifModifiedSince(Date)
-
ifUnmodifiedSince
public GetOptions ifUnmodifiedSince(Date ifUnmodifiedSince)
Only return the object if it hasn't changed since this time. Not compatible withifETagDoesntMatch(String)orifModifiedSince(Date)
-
getIfUnmodifiedSince
public String getIfUnmodifiedSince()
For use in the header If-Unmodified-Since Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).- See Also:
ifUnmodifiedSince(Date)
-
ifETagMatches
public GetOptions ifETagMatches(String eTag)
The object's eTag hash should match the parametereTag. Not compatible with#ifETagDoesntMatch(byte[])orifModifiedSince(Date)- Parameters:
eTag- hash representing the payload
-
getIfMatch
public String getIfMatch()
For use in the request header: If-Match Return the object only if its payload tag (ETag) is the same as the eTag specified, otherwise return a 412 (precondition failed).- See Also:
ifETagMatches(String)
-
ifETagDoesntMatch
public GetOptions ifETagDoesntMatch(String eTag)
The object should not have a eTag hash corresponding with the parametereTag. Not compatible withifETagMatches(String)orifUnmodifiedSince(Date)- Parameters:
eTag- hash representing the payload
-
getIfNoneMatch
public String getIfNoneMatch()
For use in the request header: If-None-Match Return the object only if its payload tag (ETag) is different from the one specified, otherwise return a 304 (not modified).- See Also:
ifETagDoesntMatch(String)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseHttpRequestOptions
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classBaseHttpRequestOptions
-
toString
public String toString()
- Overrides:
toStringin classBaseHttpRequestOptions
-
-