org.jclouds.blobstore.options
Class GetOptions

java.lang.Object
  extended by org.jclouds.blobstore.options.GetOptions

public class GetOptions
extends Object

Contains options supported for HTTP GET operations.

Usage

The recommended way to instantiate a GetOptions object is to statically import GetOptions.Builder.* and invoke a static creation method followed by an instance mutator (if needed):

import static org.jclouds.blobstore.options.GetOptions.Builder.* // this will get the first megabyte of an blob, provided it wasn't modified since yesterday blob = blobStore.getBlob("container, "blobName",range(0,1024).ifUnmodifiedSince(new Date().minusDays(1)));

Author:
Adrian Cole

Nested Class Summary
static class GetOptions.Builder
           
 
Field Summary
static GetOptions NONE
           
 
Constructor Summary
GetOptions()
           
 
Method Summary
 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).

 Date 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).

 Date 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).

 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 specified range of the object.
 GetOptions tail(long length)
          download the specified range of the object starting from the end of the object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final GetOptions NONE
Constructor Detail

GetOptions

public GetOptions()
Method Detail

range

public GetOptions range(long start,
                        long end)
download the specified range of the object.

Parameters:
start - first offset included in the response
end - last offset included in the response (inclusive).
Returns:
itself to enable daisy-chaining of expressions

startAt

public GetOptions startAt(long start)
download the specified range of the object.


tail

public GetOptions tail(long length)
download the specified range of the object starting from the end of the object.


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 Date 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 Date 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(String) 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)

getRanges

public List<String> getRanges()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2011 jclouds. All Rights Reserved.