Package org.jets3t.service.model
Class S3Bucket
- java.lang.Object
-
- org.jets3t.service.model.BaseStorageItem
-
- org.jets3t.service.model.StorageBucket
-
- org.jets3t.service.model.S3Bucket
-
public class S3Bucket extends StorageBucket
Represents an S3 bucket.- Author:
- James Murty
-
-
Field Summary
Fields Modifier and Type Field Description static StringLOCATION_ASIA_PACIFICAlias ofLOCATION_ASIA_PACIFIC_SOUTHEASTstatic StringLOCATION_ASIA_PACIFIC_NORTHEASTstatic StringLOCATION_ASIA_PACIFIC_SINGAPOREAlias ofLOCATION_ASIA_PACIFIC_SOUTHEASTstatic StringLOCATION_ASIA_PACIFIC_SOUTHEASTstatic StringLOCATION_ASIA_PACIFIC_TOKYOAlias ofLOCATION_ASIA_PACIFIC_NORTHEASTstatic StringLOCATION_EUROPEstatic StringLOCATION_USstatic StringLOCATION_US_STANDARDstatic StringLOCATION_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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static S3Bucket[]cast(StorageBucket[] buckets)StringgetLocation()booleanisLocationKnown()booleanisRequesterPays()Return the Requester Pays status of this bucket, if it is known.booleanisRequesterPaysKnown()voidsetLocation(String location)Set's the bucket's location.voidsetRequesterPays(boolean requesterPays)Set's the bucket's Requester Pays Configuration setting.StringtoString()-
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
-
-
-
-
Field Detail
-
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_SOUTHEAST
public static final String LOCATION_ASIA_PACIFIC_SOUTHEAST
- See Also:
- Constant Field Values
-
LOCATION_ASIA_PACIFIC
public static final String LOCATION_ASIA_PACIFIC
Alias ofLOCATION_ASIA_PACIFIC_SOUTHEAST- See Also:
- Constant Field Values
-
LOCATION_ASIA_PACIFIC_SINGAPORE
public static final String LOCATION_ASIA_PACIFIC_SINGAPORE
Alias ofLOCATION_ASIA_PACIFIC_SOUTHEAST- See Also:
- Constant Field Values
-
LOCATION_ASIA_PACIFIC_NORTHEAST
public static final String LOCATION_ASIA_PACIFIC_NORTHEAST
- See Also:
- Constant Field Values
-
LOCATION_ASIA_PACIFIC_TOKYO
public static final String LOCATION_ASIA_PACIFIC_TOKYO
Alias ofLOCATION_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(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 bucketlocation- A string representing the location. Legal values includeLOCATION_USand null (which are equivalent), orLOCATION_EUROPE.
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toStringin classStorageBucket
-
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 includeLOCATION_USand null (which are equivalent), orLOCATION_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
isRequesterPaysKnownmethod 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)
-
-