Ocket.exists()
This version adds method exists()
into Ocket
interface. The method checks S3 object existence. It is recommended to use it before calling any other methods, in order to avoid IOException
. For example:
Region region = new Region.Simple(key, secret);
Bucket bucket = region.bucket("example.com");
Ocket ocket = bucket.ocket("foo/README.txt");
String text;
if (ocket.exists()) {
text = new Ocket.Text(ocket).read();
} else {
text = "";
}
Besides that, this version makes Ocket
and Bucket
extend Comparable
.