/** * Deletes the container if it exists. * * @return <code>true</code> if the container did not already exist and was created; otherwise, <code>false</code>. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public boolean deleteIfExists() throws StorageException { return this.deleteIfExists(null /* accessCondition */, null /* options */, null /* opContext */); }
/** * Deletes the container if it exists. * * @return <code>true</code> if the container did not already exist and was created; otherwise, <code>false</code>. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public boolean deleteIfExists() throws StorageException { return this.deleteIfExists(null /* accessCondition */, null /* options */, null /* opContext */); }
public void deleteBucket() throws StorageException, IOException, InterruptedException { try { container.deleteIfExists(); } finally { // pool.returnObject(container); } this.close(); }
public void deleteBucket() throws StorageException, IOException, InterruptedException { CloudBlobContainer container = null; try { container = pool.borrowObject(); container.deleteIfExists(); } finally { pool.returnObject(container); } this.close(); }
@After public void blobOutputStreamTestMethodTearDown() throws StorageException { this.container.deleteIfExists(); }
@After public void pageBlobTestMethodTearDown() throws StorageException { this.container.deleteIfExists(); }
@After public void blobEncryptionTestMethodTearDown() throws StorageException { this.container.deleteIfExists(); }
@After public void appendBlobTestMethodTearDown() throws StorageException { this.container.deleteIfExists(); }
@After public void blobContainerTestMethodTearDown() throws Exception { this.container.deleteIfExists(); }
/** * This method delete the container if exist */ public boolean deleteContainerIfExist(final String containerName) throws StorageException, URISyntaxException, InvalidKeyException { CloudBlobClient cloudBlobClient = connection.getCloudStorageAccount().createCloudBlobClient(); CloudBlobContainer cloudBlobContainer = cloudBlobClient.getContainerReference(containerName); return cloudBlobContainer.deleteIfExists(null, null, AzureStorageUtils.getTalendOperationContext()); }
/** * This method delete the container if exist */ public boolean deleteContainerIfExist(final String containerName) throws StorageException, URISyntaxException, InvalidKeyException { CloudBlobClient cloudBlobClient = connection.getCloudStorageAccount().createCloudBlobClient(); CloudBlobContainer cloudBlobContainer = cloudBlobClient.getContainerReference(containerName); return cloudBlobContainer.deleteIfExists(null, null, AzureStorageUtils.getTalendOperationContext()); }
public static void deleteContainer(String containerName) throws Exception { if (Strings.isNullOrEmpty(containerName)) { log.warn("Cannot delete container with null or empty name. containerName={}", containerName); return; } log.info("Starting to delete container. containerName={}", containerName); Properties props = getAzureConfig(); CloudBlobContainer container = Utils.getBlobContainer(Utils.getConnectionStringFromProperties(props), containerName); boolean result = container.deleteIfExists(); log.info("Container deleted. containerName={} existed={}", containerName, result); }
public void deleteBlobContainer(@NotNull StorageAccount storageAccount, @NotNull BlobContainer blobContainer) throws AzureCmdException { try { CloudBlobClient client = getCloudBlobClient(storageAccount); CloudBlobContainer container = client.getContainerReference(blobContainer.getName()); container.deleteIfExists(); } catch (Throwable t) { throw new AzureCmdException("Error deleting the Blob Container", t); } }
@After public void accountSasTestMethodTearDown() throws StorageException, URISyntaxException { this.blobContainer.deleteIfExists(); this.fileShare.deleteIfExists(); this.queueQueue.deleteIfExists(); this.tableTable.deleteIfExists(); }
@Test public void testListingWithDirectorySegmented() throws URISyntaxException, StorageException { for (int i = 0; i < delimiters.length; i++) { CloudBlobContainer container = null; try { container = createContainer(delimiters[i]); testListingWithDirectorySegmented(delimiters[i], createAndPopulateContainer(delimiters[i])); } finally { container.deleteIfExists(); } } }
@Test public void testPrefixListingWithDirectorySegmented() throws URISyntaxException, StorageException { for (int i = 0; i < delimiters.length; i++) { CloudBlobContainer container = null; try { container = createContainer(delimiters[i]); testPrefixListingWithDirectorySegmented(delimiters[i], createAndPopulateContainer(delimiters[i])); } finally { container.deleteIfExists(); } } }
@Test public void testFlatListingWithDirectory() throws URISyntaxException, StorageException { for (int i = 0; i < delimiters.length; i++) { CloudBlobContainer container = null; try { container = createContainer(delimiters[i]); testFlatListingWithDirectory(delimiters[i], createAndPopulateContainer(delimiters[i])); } finally { container.deleteIfExists(); } } }
@Test public void testFlatListingWithContainer() throws URISyntaxException, StorageException { for (int i = 0; i < delimiters.length; i++) { CloudBlobContainer container = null; try { container = createContainer(delimiters[i]); testFlatListingWithContainer(delimiters[i], createAndPopulateContainer(delimiters[i])); } finally { container.deleteIfExists(); } } }
@Test public void testHierarchicalTraversal() throws URISyntaxException, StorageException { for (int i = 0; i < delimiters.length; i++) { CloudBlobContainer container = null; try { container = createContainer(delimiters[i]); testHierarchicalTraversal(delimiters[i], createContainer(delimiters[i])); } finally { container.deleteIfExists(); } } }
public CloudBlobContainer getContainer(String name) throws URISyntaxException, StorageException, InvalidKeyException { int mappedPort = getMappedPort(); CloudStorageAccount cloud = CloudStorageAccount.parse("DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:" + mappedPort + "/devstoreaccount1;"); CloudBlobContainer container = cloud.createCloudBlobClient().getContainerReference(name); container.deleteIfExists(); container.create(); return container; }