org.jets3t.service.model
Class S3Bucket

java.lang.Object
  extended by org.jets3t.service.model.BaseS3Object
      extended by org.jets3t.service.model.S3Bucket
All Implemented Interfaces:
Serializable

public class S3Bucket
extends BaseS3Object

Represents an S3 bucket.

Author:
James Murty
See Also:
Serialized Form

Field Summary
static String LOCATION_ASIA_PACIFIC
           
static String LOCATION_EUROPE
           
static String LOCATION_US
           
static String LOCATION_US_STANDARD
           
static String LOCATION_US_WEST
           
static String METADATA_HEADER_CREATION_DATE
           
static String METADATA_HEADER_OWNER
           
 
Constructor Summary
S3Bucket()
          Create a bucket without any name or location specified
S3Bucket(String name)
          Create a bucket with a name.
S3Bucket(String name, String location)
          Create a bucket with a name and a location.
 
Method Summary
 AccessControlList getAcl()
           
 Date getCreationDate()
           
 String getLocation()
           
 String getName()
           
 S3Owner getOwner()
           
 boolean isLocationKnown()
           
 boolean isRequesterPays()
          Return the Requester Pays status of this bucket, if it is known.
 boolean isRequesterPaysKnown()
           
 void setAcl(AccessControlList acl)
          Sets the bucket's Access Control List in S3 - this should only be used internally by J3tS3t methods that retrieve information directly from S3.
 void setCreationDate(Date creationDate)
          Sets the bucket's creation date in S3 - this should only be used internally by JetS3t methods that retrieve information directly from S3.
 void setLocation(String location)
          Set's the bucket's location.
 void setName(String name)
          Set the name of the bucket.
 void setOwner(S3Owner owner)
          Sets the bucket's owner in S3 - this should only be used internally by JetS3t methods that retrieve information directly from S3.
 void setRequesterPays(boolean requesterPays)
          Set's the bucket's Requester Pays Configuration setting.
 String toString()
           
 
Methods inherited from class org.jets3t.service.model.BaseS3Object
addAllMetadata, addMetadata, addMetadata, addMetadata, containsMetadata, getMetadata, getMetadataMap, removeMetadata, replaceAllMetadata
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

METADATA_HEADER_CREATION_DATE

public static final String METADATA_HEADER_CREATION_DATE
See Also:
Constant Field Values

METADATA_HEADER_OWNER

public static final String METADATA_HEADER_OWNER
See Also:
Constant Field Values

LOCATION_US

public static final String LOCATION_US

LOCATION_US_STANDARD

public static final String LOCATION_US_STANDARD

LOCATION_US_WEST

public static final String LOCATION_US_WEST
See Also:
Constant Field Values

LOCATION_EUROPE

public static final String LOCATION_EUROPE
See Also:
Constant Field Values

LOCATION_ASIA_PACIFIC

public static final String LOCATION_ASIA_PACIFIC
See Also:
Constant Field Values
Constructor Detail

S3Bucket

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


S3Bucket

public S3Bucket(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(String name,
                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 String toString()
Overrides:
toString in class Object

getOwner

public S3Owner getOwner()
Returns:
the bucket's owner, or null if it is unknown.

setOwner

public void setOwner(S3Owner owner)
Sets the bucket's owner in S3 - this should only be used internally by JetS3t methods that retrieve information directly from S3.

Parameters:
owner -

getCreationDate

public Date getCreationDate()
Returns:
the bucket's creation date, or null if it is unknown.

setCreationDate

public void setCreationDate(Date creationDate)
Sets the bucket's creation date in S3 - this should only be used internally by JetS3t methods that retrieve information directly from S3.

Parameters:
creationDate -

getAcl

public AccessControlList getAcl()
Returns:
the bucket's Access Control List, or null if it is unknown.

setAcl

public void setAcl(AccessControlList acl)
Sets the bucket's Access Control List in S3 - this should only be used internally by J3tS3t methods that retrieve information directly from S3.

Parameters:
acl -

getName

public String getName()
Returns:
the name of the bucket.

setName

public void setName(String name)
Set the name of the bucket. All buckets in S3 share a single namespace, so choose a unique name for your bucket.

Parameters:
name - the name for the bucket

setLocation

public void setLocation(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 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.