Merge pull request #850 from andrewgaul/delete-container-1.5.x-backports

Delete container 1.5.x backports
This commit is contained in:
Adrian Cole 2012-09-20 12:09:39 -07:00
commit f00a4284c9
2 changed files with 7 additions and 3 deletions

View File

@ -62,7 +62,7 @@ public class S3Utils {
*/
public static boolean deleteAndVerifyContainerGone(S3Client sync, String container) {
sync.deleteBucketIfEmpty(container);
return sync.bucketExists(container);
return !sync.bucketExists(container);
}
private static final Predicate<Annotation> ANNOTATIONTYPE_BUCKET = new Predicate<Annotation>() {

View File

@ -22,6 +22,7 @@ import static org.jclouds.blobstore.options.ListContainerOptions.Builder.recursi
import static org.jclouds.concurrent.FutureIterables.awaitCompletion;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@ -95,8 +96,11 @@ public class DeleteAllKeysInList implements ClearListStrategy, ClearContainerStr
for (int i = 0; i < maxErrors; ) {
// fetch partial directory listing
try {
listing = Futures.getUnchecked(connection.list(containerName, options));
} catch (RuntimeException ee) {
listing = connection.list(containerName, options).get();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
break;
} catch (ExecutionException ee) {
++i;
if (i == maxErrors) {
throw Throwables.propagate(ee.getCause());