@Override public boolean delete(StorageObject blob, Map<Option, ?> options) { Span span = startSpan(HttpStorageRpcSpans.SPAN_NAME_DELETE_OBJECT); Scope scope = tracer.withSpan(span); try { deleteCall(blob, options).execute(); return true; } catch (IOException ex) { span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage())); StorageException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return false; } throw serviceException; } finally { scope.close(); span.end(); } }
storage.objects().delete(bucketName, item.getName()).execute();
storage.objects().delete(bucketName, originalItem.getName()).execute();
while (!done && retryCount > 0) { try { storage.delete(destPath.getBucket(), shardToDelete).execute(); done = true; } catch (Exception ex) {
.objects() .delete(projectName + "-cloud-pubsub-loadtest", filePath.getFileName().toString()) .execute(); } catch (GoogleJsonResponseException e) { if (e.getStatusCode() != NOT_FOUND) {
while (!done && retryCount > 0) { try { storage.delete(destPath.getBucket(), shardToDelete).execute(); done = true; } catch (Exception ex) {
@Override public boolean delete(StorageObject blob, Map<Option, ?> options) { Span span = startSpan(HttpStorageRpcSpans.SPAN_NAME_DELETE_OBJECT); Scope scope = tracer.withSpan(span); try { deleteCall(blob, options).execute(); return true; } catch (IOException ex) { span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage())); StorageException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return false; } throw serviceException; } finally { scope.close(); span.end(); } }
/** * Delete single file test output. * * @param outputPath path to the output file to be deleted. * @throws Exception */ public void deleteOutput(String outputPath) throws Exception { // boilerplate GcsPath path = GcsPath.fromUri(outputPath); GcsOptions gcsOptions = popts.as(GcsOptions.class); Storage storage = Transport.newStorageClient(gcsOptions).build(); // do the actual work storage.objects().delete(path.getBucket(), path.getObject()).execute(); }
List<StorageObject> storageObjects = new ArrayList(); torage.Objects.List listObjects = storage.objects().list(bucket); Objects objects = listObjects.execute(); storageObjects.addAll(objects.getItems()); for (StorageObject storageObject : workBucketObjects) { Storage.Objects.Delete delete = storage.objects().delete(bucketName,storageObject.getName()); delete.execute();
/** * Deletes a file within a bucket * * @param bucketName * Name of bucket that contains the file * @param fileName * The file to delete * @throws Exception */ public static void deleteFile(String bucketName, String fileName) throws Exception { Storage storage = getStorage(); storage.objects().delete(bucketName, fileName).execute(); }
@Override public boolean delete(StorageObject blob, Map<Option, ?> options) { try { deleteRequest(blob, options).execute(); return true; } catch (IOException ex) { StorageException serviceException = translate(ex); if (serviceException.code() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }
/** * Deletes an object in a bucket. * * @param path the path to the object to delete. * @param bucketName the bucket the object is contained in. */ public static void deleteObject(String path, String bucketName) throws IOException, GeneralSecurityException { Storage client = StorageFactory.getService(); client.objects().delete(bucketName, path).execute(); } // [END delete_object]
/** {@inheritDoc} */ @Override public void unregisterAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException { assert !F.isEmpty(addrs); init(); for (InetSocketAddress addr : addrs) { String key = keyFromAddr(addr); try { Storage.Objects.Delete deleteObject = storage.objects().delete(bucketName, key); deleteObject.execute(); } catch (Exception e) { throw new IgniteSpiException("Failed to delete entry [bucketName=" + bucketName + ", entry=" + key + ']', e); } } }
public void delete(final String bucket, final String path) throws IOException { storage.objects().delete(bucket, path).execute(); }