org.jets3t.service.model
Class S3Bucket

java.lang.Object
  extended by org.jets3t.service.model.BaseStorageItem
      extended by org.jets3t.service.model.StorageBucket
          extended by org.jets3t.service.model.S3Bucket

public class S3Bucket
extends StorageBucket

Represents an S3 bucket.


Field Summary
static java.lang.String LOCATION_ASIA_PACIFIC
          Alias of LOCATION_ASIA_PACIFIC_SOUTHEAST
static java.lang.String LOCATION_ASIA_PACIFIC_NORTHEAST
           
static java.lang.String LOCATION_ASIA_PACIFIC_SINGAPORE
          Alias of LOCATION_ASIA_PACIFIC_SOUTHEAST
static java.lang.String LOCATION_ASIA_PACIFIC_SOUTHEAST
           
static java.lang.String LOCATION_ASIA_PACIFIC_TOKYO
          Alias of LOCATION_ASIA_PACIFIC_NORTHEAST
static java.lang.String LOCATION_EUROPE
           
static java.lang.String LOCATION_US
           
static java.lang.String LOCATION_US_STANDARD
           
static java.lang.String LOCATION_US_WEST
           
 
Fields inherited from class org.jets3t.service.model.BaseStorageItem
METADATA_HEADER_CONTENT_DISPOSITION, METADATA_HEADER_CONTENT_ENCODING, METADATA_HEADER_CONTENT_LANGUAGE, METADATA_HEADER_CONTENT_LENGTH, METADATA_HEADER_CONTENT_MD5, METADATA_HEADER_CONTENT_TYPE, METADATA_HEADER_CREATION_DATE, METADATA_HEADER_DATE, METADATA_HEADER_ETAG, METADATA_HEADER_LAST_MODIFIED_DATE
 
Constructor Summary
S3Bucket()
          Create a bucket without any name or location specified
S3Bucket(java.lang.String name)
          Create a bucket with a name.
S3Bucket(java.lang.String name, java.lang.String location)
          Create a bucket with a name and a location.
 
Method Summary
static S3Bucket[] cast(StorageBucket[] buckets)
           
 java.lang.String getLocation()
           
 boolean isLocationKnown()
           
 boolean isRequesterPays()
          Return the Requester Pays status of this bucket, if it is known.
 boolean isRequesterPaysKnown()
           
 void setLocation(java.lang.String location)
          Set's the bucket's location.
 void setRequesterPays(boolean requesterPays)
          Set's the bucket's Requester Pays Configuration setting.
 java.lang.String toString()
           
 
Methods inherited from class org.jets3t.service.model.StorageBucket
getAcl, getCreationDate, setAcl, setCreationDate
 
Methods inherited from class org.jets3t.service.model.BaseStorageItem
addAllMetadata, addMetadata, addMetadata, addMetadata, containsMetadata, getMetadata, getMetadataMap, getName, getOwner, removeMetadata, replaceAllMetadata, setName, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCATION_US

public static final java.lang.String LOCATION_US

LOCATION_US_STANDARD

public static final java.lang.String LOCATION_US_STANDARD

LOCATION_US_WEST

public static final java.lang.String LOCATION_US_WEST
See Also:
Constant Field Values

LOCATION_EUROPE

public static final java.lang.String LOCATION_EUROPE
See Also:
Constant Field Values

LOCATION_ASIA_PACIFIC_SOUTHEAST

public static final java.lang.String LOCATION_ASIA_PACIFIC_SOUTHEAST
See Also:
Constant Field Values

LOCATION_ASIA_PACIFIC

public static final java.lang.String LOCATION_ASIA_PACIFIC
Alias of LOCATION_ASIA_PACIFIC_SOUTHEAST

See Also:
Constant Field Values

LOCATION_ASIA_PACIFIC_SINGAPORE

public static final java.lang.String LOCATION_ASIA_PACIFIC_SINGAPORE
Alias of LOCATION_ASIA_PACIFIC_SOUTHEAST

See Also:
Constant Field Values

LOCATION_ASIA_PACIFIC_NORTHEAST

public static final java.lang.String LOCATION_ASIA_PACIFIC_NORTHEAST
See Also:
Constant Field Values

LOCATION_ASIA_PACIFIC_TOKYO

public static final java.lang.String LOCATION_ASIA_PACIFIC_TOKYO
Alias of LOCATION_ASIA_PACIFIC_NORTHEAST

See Also:
Constant Field Values
Constructor Detail

S3Bucket

public S3Bucket()
Create a bucket without any name or location specified


S3Bucket

public S3Bucket(java.lang.String name)
Create a bucket with a name. All buckets in S3 share a single namespace, so choose a unique name for your bucket.

Parameters:
name - the name for the bucket

S3Bucket

public S3Bucket(java.lang.String name,
                java.lang.String location)
Create a bucket with a name and a location. All buckets in S3 share a single namespace, so choose a unique name for your bucket.

Parameters:
name - the name for the bucket
location - A string representing the location. Legal values include LOCATION_US and null (which are equivalent), or LOCATION_EUROPE.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class StorageBucket

setLocation

public void setLocation(java.lang.String location)
Set's the bucket's location. This method should only be used internally by JetS3t methods that retrieve information directly from S3.

Parameters:
location - A string representing the location. Legal values include LOCATION_US and null (which are equivalent), or LOCATION_EUROPE.

isLocationKnown

public boolean isLocationKnown()
Returns:
true if this object knows the bucket's location, false otherwise.

getLocation

public java.lang.String getLocation()
Returns:
the bucket's location represented as a string. "EU" denotes a bucket located in Europe, while null denotes a bucket located in the US.

setRequesterPays

public void setRequesterPays(boolean requesterPays)
Set's the bucket's Requester Pays Configuration setting. This method should only be used internally by JetS3t methods that retrieve information directly from S3.

Parameters:
requesterPays - true if the bucket is configured for Requester Pays, false if it is configured for Owner pays.

isRequesterPaysKnown

public boolean isRequesterPaysKnown()
Returns:
true if this bucket object knows its Requester Pays status, false otherwise.

isRequesterPays

public boolean isRequesterPays()
Return the Requester Pays status of this bucket, if it is known.

WARNING: Before you use this method, always check with the isRequesterPaysKnown method to ensure that the Requester Pays status has been set, otherwise the result of this method is meaningless.

Returns:
true if the bucket is configured for Requester Pays, false if it is configured for Owner pays or the Request Pays configuration status is unknown.

cast

public static S3Bucket[] cast(StorageBucket[] buckets)