public class Bucket
extends java.lang.Object
implements java.io.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(java.lang.String name)
Creates a bucket with a name.
|
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getCreationDate()
Gets the bucket's creation date.
|
java.lang.String |
getName()
Gets the name of the bucket.
|
Owner |
getOwner()
Gets the bucket's owner.
|
void |
setCreationDate(java.util.Date creationDate)
For internal use only.
|
void |
setName(java.lang.String name)
Sets the name of the bucket.
|
void |
setOwner(Owner owner)
For internal use only.
|
java.lang.String |
toString() |
public Bucket()
Bucket(String)
public Bucket(java.lang.String name)
name
- The name for the bucket.Bucket()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public Owner getOwner()
null
if the bucket's owner
is unknown.null
if it is unknown.setOwner(Owner)
public void setOwner(Owner owner)
owner
- The bucket's owner.Bucket#getOwner()
public java.util.Date getCreationDate()
null
if the
creation date is not known.null
if not known.public void setCreationDate(java.util.Date creationDate)
creationDate
- The bucket's creation date.public java.lang.String getName()
setName(String)
public void setName(java.lang.String name)
name
- The name for the bucket.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.