Esempio n. 1
0
  @Override
  public void createContainer(String container, Config config) {
    super.createContainer(container, config);
    try {
      if (!client.doesBucketExist(container)) {

        client.createBucket(container);
      }
    } catch (Exception e) {
      throw new StorageException(e);
    }
  }
Esempio n. 2
0
 @Override
 public void deleteContainer(String container, Config config) {
   super.deleteContainer(container, config);
   try {
     if (client.doesBucketExist(container)) {
       client.deleteBucket(container);
     }
   } catch (AmazonS3Exception awse) {
     if (awse.getStatusCode() != HttpStatus.SC_NOT_FOUND) {
       throw new StorageException(awse);
     }
   } catch (Exception e) {
     throw new StorageException(e);
   }
 }