Package com.jcabi.s3
Interface Bucket
- All Superinterfaces:
Comparable<Bucket>
- All Known Implementing Classes:
Bucket.Prefixed,CdBucket,FkBucket,ReBucket
Amazon S3 bucket.
You get an instance of this interface from Region, for example:
Region region = new Region.Simple(key, secret);
Bucket bucket = region.bucket("my.example.com");
for (String key : bucket.list("")) {
System.out.println(
"key: " + key + ", last modified: "
+ bucket.get(key).meta().getLastModified()
);
}- Since:
- 0.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classCreates bucket with specified origin bucket and prefix. -
Method Summary
Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
region
Region region()Get region we're in.- Returns:
- Region
-
name
String name()Get bucket name.- Returns:
- Bucket name
-
ocket
Get object.- Parameters:
key- Name of it in the bucket- Returns:
- Ocket
-
exists
Checks if the bucket exists.- Returns:
- If the bucket exists
true, otherwisefalse - Throws:
IOException- If any failure happens
-
remove
Delete object from bucket.- Parameters:
key- Name of it in the bucket- Throws:
IOException- If not found or any other failure
-
list
List object names with a given prefix.- Parameters:
pfx- Prefix to use- Returns:
- Iterable of names
- Throws:
IOException- If fails- Since:
- 0.3
-