/** * Tries to delete all containers, runs up to two times */ protected static void deleteEverything(final BlobStoreContext context) throws Exception { try { for (int i = 0; i < 2; i++) { Iterable<? extends StorageMetadata> testContainers = Iterables.filter(context.getBlobStore().list(), new Predicate<StorageMetadata>() { public boolean apply(StorageMetadata input) { return (input.getType() == StorageType.CONTAINER || input.getType() == StorageType.FOLDER) && input.getName().startsWith(CONTAINER_PREFIX); } }); for (StorageMetadata container : testContainers) { deleteContainerOrWarnIfUnable(context, container.getName()); } } // try twice } catch (CancellationException e) { throw e; } }
/** * Tries to delete all containers, runs up to two times */ protected static void deleteEverything(final BlobStoreContext context) throws Exception { try { for (int i = 0; i < 2; i++) { Iterable<? extends StorageMetadata> testContainers = Iterables.filter(context.getBlobStore().list(), new Predicate<StorageMetadata>() { public boolean apply(StorageMetadata input) { return (input.getType() == StorageType.CONTAINER || input.getType() == StorageType.FOLDER) && input.getName().startsWith(CONTAINER_PREFIX); } }); for (StorageMetadata container : testContainers) { deleteContainerOrWarnIfUnable(context, container.getName()); } } // try twice } catch (CancellationException e) { throw e; } }
containerNames.put(containerName); else { deleteContainerOrWarnIfUnable(context, containerName); containerCount++; deleteContainerOrWarnIfUnable(context, containerName); containerCount++;
containerNames.put(containerName); else { deleteContainerOrWarnIfUnable(context, containerName); containerCount++; deleteContainerOrWarnIfUnable(context, containerName); containerCount++;