*/
public void insert(Bucket b) throws S3ConnectionException {
try {
if (b.getEntries().isEmpty()) {
if (!connection.getConnection().deleteObject(rootS3Bucket, b.getBucketName()).get())
throw new S3ConnectionException(String.format("Could not delete object [%2s] in s3bucket [%1s] ", rootS3Bucket.getName(), b.getBucketName()));
} else {
S3Object s3Object = new S3Object();
s3Object.setKey(b.getBucketName());
s3Object.setContent(connection.marshaller.objectToByteBuffer(b));
s3Object.setContentType("application/octet-string");