storage.objects().delete(bucketName, item.getName()).execute();
storage.objects().delete(bucketName, originalItem.getName()).execute();
storage .objects() .delete(projectName + "-cloud-pubsub-loadtest", filePath.getFileName().toString()) .execute(); } catch (GoogleJsonResponseException e) {
configureRequest(gcs.objects().delete(bucketName, objectName), bucketName) .setIfGenerationMatch(generationId); batchHelper.queue(
while (!done && retryCount > 0) { try { storage.delete(destPath.getBucket(), shardToDelete).execute(); done = true; } catch (Exception ex) {
while (!done && retryCount > 0) { try { storage.delete(destPath.getBucket(), shardToDelete).execute(); done = true; } catch (Exception ex) {
private void enqueueDelete(final GcsPath file, BatchRequest batch) throws IOException { Storage.Objects.Delete deleteRequest = storageClient.objects().delete(file.getBucket(), file.getObject()); deleteRequest.queue( batch, new JsonBatchCallback<Void>() { @Override public void onSuccess(Void obj, HttpHeaders responseHeaders) { LOG.debug("Successfully deleted {}", file); } @Override public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) throws IOException { if (e.getCode() == 404) { LOG.info( "Ignoring failed deletion of file {} which already does not exist: {}", file, e); } else { throw new IOException(String.format("Error trying to delete %s: %s", file, e)); } } }); }
/** * 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(); }
/** * 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(); }
private Storage.Objects.Delete deleteRequest(StorageObject blob, Map<Option, ?> options) throws IOException { return storage.objects() .delete(blob.getBucket(), blob.getName()) .setGeneration(blob.getGeneration()) .setIfMetagenerationMatch(IF_METAGENERATION_MATCH.getLong(options)) .setIfMetagenerationNotMatch(IF_METAGENERATION_NOT_MATCH.getLong(options)) .setIfGenerationMatch(IF_GENERATION_MATCH.getLong(options)) .setIfGenerationNotMatch(IF_GENERATION_NOT_MATCH.getLong(options)); }
private Storage.Objects.Delete deleteCall(StorageObject blob, Map<Option, ?> options) throws IOException { return storage .objects() .delete(blob.getBucket(), blob.getName()) .setGeneration(blob.getGeneration()) .setIfMetagenerationMatch(Option.IF_METAGENERATION_MATCH.getLong(options)) .setIfMetagenerationNotMatch(Option.IF_METAGENERATION_NOT_MATCH.getLong(options)) .setIfGenerationMatch(Option.IF_GENERATION_MATCH.getLong(options)) .setIfGenerationNotMatch(Option.IF_GENERATION_NOT_MATCH.getLong(options)) .setUserProject(Option.USER_PROJECT.getString(options)); }
@Override public void onSuccess(StorageObject storageObject, HttpHeaders httpHeaders) throws IOException { final Long generation = storageObject.getGeneration(); Storage.Objects.Delete deleteObject = configureRequest(gcs.objects().delete(bucketName, objectName), bucketName) .setIfGenerationMatch(generation); batchHelper.queue( deleteObject, getDeletionCallback( resourceId, innerExceptions, batchHelper, attempt, generation)); }
/** * 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); } } }
private Storage.Objects.Delete deleteCall(StorageObject blob, Map<Option, ?> options) throws IOException { return storage .objects() .delete(blob.getBucket(), blob.getName()) .setGeneration(blob.getGeneration()) .setIfMetagenerationMatch(Option.IF_METAGENERATION_MATCH.getLong(options)) .setIfMetagenerationNotMatch(Option.IF_METAGENERATION_NOT_MATCH.getLong(options)) .setIfGenerationMatch(Option.IF_GENERATION_MATCH.getLong(options)) .setIfGenerationNotMatch(Option.IF_GENERATION_NOT_MATCH.getLong(options)) .setUserProject(Option.USER_PROJECT.getString(options)); }
public void delete(final String bucket, final String path) throws IOException { storage.objects().delete(bucket, path).execute(); }