@Immutable public interface Bucket extends Comparable<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() ); }
Modifier and Type | Interface and Description |
---|---|
static class |
Bucket.Prefixed
Prefixed.
|
Modifier and Type | Method and Description |
---|---|
Iterable<String> |
list(String pfx)
List object names with a given prefix.
|
String |
name()
Get bucket name.
|
Ocket |
ocket(String key)
Get object.
|
Region |
region()
Get region we're in.
|
void |
remove(String key)
Delete object from bucket.
|
compareTo
@NotNull(message="bucket name is never NULL") String name()
@NotNull(message="ocket is never NULL") Ocket ocket(@NotNull(message="S3 key can\'t be NULL") String key)
key
- Name of it in the bucketvoid remove(@NotNull(message="S3 key can\'t be NULL") String key) throws IOException
key
- Name of it in the bucketIOException
- If not found or any other failureIterable<String> list(@NotNull(message="prefix can\'t be NULL") String pfx) throws IOException
pfx
- Prefix to useIOException
- If failsCopyright © 2012–2014 jcabi.com. All rights reserved.