public class GetOptions extends BaseHttpRequestOptions
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 and Description
static class
GetOptions.Builder
-
Field Summary
Fields
Modifier and Type
Field and Description
static GetOptions
NONE
-
Fields inherited from class org.jclouds.http.options.BaseHttpRequestOptions
formParameters, headers, pathSuffix, payload, queryParameters
-
Constructor Summary
Constructors
Constructor and Description
GetOptions()
-
Method Summary
Methods
Modifier and Type
Method and Description
com.google.common.collect.Multimap<String,String>
buildRequestHeaders()
Builds headers representing options.
boolean
equals(Object obj)
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).
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).
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).
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).
String
getRange()
For use in the header Range
List<String>
getRanges()
int
hashCode()
GetOptions
ifETagDoesntMatch(String eTag)
The object should not have a eTag hash corresponding with the parameter eTag
.
GetOptions
ifETagMatches(String eTag)
The object's eTag hash should match the parameter eTag
.
GetOptions
ifModifiedSince(Date ifModifiedSince)
Only return the object if it has changed since this time.
GetOptions
ifUnmodifiedSince(Date ifUnmodifiedSince)
Only return the object if it hasn't changed since this time.
GetOptions
range(long start,
long end)
download the specified range of the object.
GetOptions
startAt(long start)
download the object offset at start
GetOptions
tail(long count)
download the last count
bytes of the object
String
toString()
-
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: BaseHttpRequestOptions
Builds headers representing options.
- Specified by:
buildRequestHeaders
in interface HttpRequestOptions
- Overrides:
buildRequestHeaders
in class BaseHttpRequestOptions
- 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 at start
-
tail
public GetOptions tail(long count)
download the last count
bytes 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 with ifETagMatches(String)
or ifUnmodifiedSince(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 with ifETagDoesntMatch(String)
or ifModifiedSince(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 parameter eTag
.
Not compatible with #ifETagDoesntMatch(byte[])
or ifModifiedSince(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 parameter eTag
.
Not compatible with ifETagMatches(String)
or ifUnmodifiedSince(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:
hashCode
in class BaseHttpRequestOptions
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in class BaseHttpRequestOptions
-
toString
public String toString()
- Overrides:
toString
in class BaseHttpRequestOptions
Copyright © 2009-2018 The Apache Software Foundation. All Rights Reserved.