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
Represents an S3 bucket.
- Author:
- James Murty
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Alias ofLOCATION_ASIA_PACIFIC_SOUTHEAST
static final String
static final String
Alias ofLOCATION_ASIA_PACIFIC_SOUTHEAST
static final String
static final String
Alias ofLOCATION_ASIA_PACIFIC_NORTHEAST
static final String
static final String
static final String
static final String
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic S3Bucket[]
cast
(StorageBucket[] buckets) boolean
boolean
Return the Requester Pays status of this bucket, if it is known.boolean
void
setLocation
(String location) Set's the bucket's location.void
setRequesterPays
(boolean requesterPays) Set's the bucket's Requester Pays Configuration setting.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
-
Field Details
-
LOCATION_US
-
LOCATION_US_STANDARD
-
LOCATION_US_WEST
- See Also:
-
LOCATION_EUROPE
- See Also:
-
LOCATION_ASIA_PACIFIC_SOUTHEAST
- See Also:
-
LOCATION_ASIA_PACIFIC
Alias ofLOCATION_ASIA_PACIFIC_SOUTHEAST
- See Also:
-
LOCATION_ASIA_PACIFIC_SINGAPORE
Alias ofLOCATION_ASIA_PACIFIC_SOUTHEAST
- See Also:
-
LOCATION_ASIA_PACIFIC_NORTHEAST
- See Also:
-
LOCATION_ASIA_PACIFIC_TOKYO
Alias ofLOCATION_ASIA_PACIFIC_NORTHEAST
- See Also:
-
-
Constructor Details
-
S3Bucket
public S3Bucket()Create a bucket without any name or location specified -
S3Bucket
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
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_US
and null (which are equivalent), orLOCATION_EUROPE
.
-
-
Method Details
-
toString
- Overrides:
toString
in classStorageBucket
-
setLocation
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_US
and null (which are equivalent), orLOCATION_EUROPE
.
-
isLocationKnown
public boolean isLocationKnown()- Returns:
- true if this object knows the bucket's location, false otherwise.
-
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
-