private void renameBlob(CloudBlob blob, CloudBlobDirectory newParent) throws IOException { copyBlob(blob, newParent); try { blob.delete(); } catch (StorageException e) { throw new IOException(e); } }
/** * Deletes the blob. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final void delete() throws StorageException { this.delete(DeleteSnapshotsOption.NONE, null /* accessCondition */, null /* options */, null /* opContext */); }
private void renameBlob(CloudBlob blob, CloudBlobDirectory newParent) throws IOException { copyBlob(blob, newParent); try { blob.delete(); } catch (StorageException e) { throw new IOException(e); } }
/** * Deletes the blob. * * If a delete retention policy is enabled on the service, the blob will be retained for a specified period of time, * before being removed permanently by garbage collection. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final void delete() throws StorageException { this.delete(DeleteSnapshotsOption.NONE, null /* accessCondition */, null /* options */, null /* opContext */); }
@Override public boolean delete(String archiveName) { try { getBlobs(archiveName) .forEach(cloudBlob -> { try { cloudBlob.delete(); } catch (StorageException e) { log.error("Can't delete segment {}", cloudBlob.getUri().getPath(), e); } }); return true; } catch (IOException e) { log.error("Can't delete archive {}", archiveName, e); return false; } }
@Override public boolean delete(String archiveName) { try { getBlobs(archiveName) .forEach(cloudBlob -> { try { cloudBlob.delete(); } catch (StorageException e) { log.error("Can't delete segment {}", cloudBlob.getUri().getPath(), e); } }); return true; } catch (IOException e) { log.error("Can't delete archive {}", archiveName, e); return false; } }
private void doDeleteBlock(CloudBlob client, Exchange exchange) throws Exception { LOG.trace("Deleting a blob [{}] from exchange [{}]...", getConfiguration().getBlobName(), exchange); client.delete(); }
@Override public void delete(OperationContext opContext, SelfRenewingLease lease) throws StorageException { getBlob().delete(DeleteSnapshotsOption.NONE, getLeaseCondition(lease), null, opContext); }
@Override public void delete(OperationContext opContext, SelfRenewingLease lease) throws StorageException { getBlob().delete(DeleteSnapshotsOption.NONE, getLeaseCondition(lease), null, opContext); }
String nm = bi.getName(); if (nm.endsWith(suffix)) { bi.delete(); String fldr = nm.substring(0, nm.length() - suffix.length()); Iterator<ListBlobItem> _it = container.listBlobs(fldr).iterator();
@Override public void purge(String prefix) throws IOException { try { // Attempts to purge may occur before opening any streams so first, // check if a session exists, if not create a session with the Azure // storage server. if (null == storageInteractionLayer) { final String errMsg = String.format( "Storage session expected for URI '%s' but does not exist.", sessionUri); throw new AssertionError(errMsg); } if (checkContainer(ContainerAccessType.ReadThenWrite) == ContainerState.DoesntExist) { // Container doesn't exist, no need to do anything. return; } // Get all blob items with the given prefix from the container and delete // them. Iterable<ListBlobItem> objects = listRootBlobs(prefix, false, false); for (ListBlobItem blobItem : objects) { ((CloudBlob) blobItem).delete(DeleteSnapshotsOption.NONE, null, null, getInstrumentedContext()); } } catch (Exception e) { // Re-throw as an Azure storage exception. // throw new AzureException(e); } }
if (exists) { try { this.delete(deleteSnapshotsOption, accessCondition, options, opContext); return true;
if (exists) { try { this.delete(deleteSnapshotsOption, accessCondition, options, opContext); return true;