public class Bucket extends Object implements Serializable
Represents an Amazon S3 bucket.
Every object stored in Amazon S3 is contained within a bucket. Buckets partition the namespace of objects stored in Amazon S3 at the top level. Within a bucket, any name can be used for objects. However, bucket names must be unique across all of Amazon S3.
Bucket ownership is similar to the ownership of Internet domain names. Within Amazon S3, only a single user owns each bucket. Once a uniquely named bucket is created in Amazon S3, organize and name the objects within the bucket in any way. Ownership of the bucket is retained as long as the owner has an Amazon S3 account.
To conform with DNS requirements, the following constraints apply:
There are no limits to the number of objects that can be stored in a bucket. Performance does not vary based on the number of buckets used. Store all objects within a single bucket or organize them across several buckets.
Constructor and Description |
---|
Bucket()
Constructs a bucket without any name specified.
|
Bucket(String name)
Creates a bucket with a name.
|
Modifier and Type | Method and Description |
---|---|
Date |
getCreationDate()
Gets the bucket's creation date.
|
String |
getCreationTemplateId()
IBM
Returns the creationTemplateId associated with the bucket.
|
String |
getLocationConstraint()
IBM
Returns the locationConstraint associated with the bucket
This will only have populated information when used in conjunction with
the Extended Listing support to the COS S3 GET Service API
|
String |
getName()
Gets the name of the bucket.
|
Owner |
getOwner()
Gets the bucket's owner.
|
void |
setCreationDate(Date creationDate)
For internal use only.
|
void |
setCreationTemplateId(String creationTemplateId)
For internal use only:
IBM
set the bucket creationTemplateId from the api response
|
void |
setLocationConstraint(String locationConstraint)
For internal use only:
IBM
set the bucket locationConstraint from the api response
|
void |
setName(String name)
Sets the name of the bucket.
|
void |
setOwner(Owner owner)
For internal use only.
|
String |
toString() |
public Bucket()
Bucket(String)
public String toString()
toString
in class Object
Object.toString()
public Owner getOwner()
null
if the bucket's owner is unknown.null
if it is unknown.Bucket.setOwner(Owner)
public void setOwner(Owner owner)
owner
- The bucket's owner.Bucket.getOwner()
public Date getCreationDate()
null
if the creation date is not known.null
if not known.public void setCreationDate(Date creationDate)
creationDate
- The bucket's creation date.public String getName()
Bucket.setName(String)
public void setName(String name)
name
- The name for the bucket.public String getLocationConstraint()
public void setLocationConstraint(String locationConstraint)
locationConstraint
- The location constraint for the bucket.public String getCreationTemplateId()
public void setCreationTemplateId(String creationTemplateId)
creationTemplateId
- The templateId used on bucket creationCopyright © 2024. All rights reserved.