Ejemplo n.º 1
0
 /**
  * This implementation invokes {@link #clearContainer} then {@link S3Client#deleteBucketIfEmpty}
  * until it is true.
  */
 public void clearAndDeleteContainer(final String container) {
   try {
     if (!Assertions.eventuallyTrue(
         new Supplier<Boolean>() {
           public Boolean get() {
             clearContainer(container);
             return sync.deleteBucketIfEmpty(container);
           }
         },
         30000)) {
       throw new IllegalStateException(container + " still exists after deleting!");
     }
   } catch (InterruptedException e) {
     new IllegalStateException(container + " interrupted during deletion!", e);
   }
 }
Ejemplo n.º 2
0
 protected void deleteAndEnsurePathGone(final String container) {
   try {
     if (!Assertions.eventuallyTrue(
         new Supplier<Boolean>() {
           public Boolean get() {
             try {
               clearContainer(container, recursive());
               return deleteAndVerifyContainerGone(container);
             } catch (ContainerNotFoundException e) {
               return true;
             }
           }
         },
         30000)) {
       throw new IllegalStateException(container + " still exists after deleting!");
     }
   } catch (InterruptedException e) {
     throw new IllegalStateException(container + " interrupted during deletion!", e);
   }
 }