@Override protected boolean deleteObject(String key) throws IOException { try { mClient.deleteObject(mBucketName, key); } catch (AmazonClientException e) { LOG.error("Failed to delete {}", key, e); return false; } return true; }
@Override public void deleteObject(String bucketName, String key) throws SdkClientException, AmazonServiceException { deleteObject(new DeleteObjectRequest(bucketName, key)); }
/** * Delete a file from S3 Storage. * * @param bucket * The name of the bucket * @param key * The record key of the file to delete. * @return OK on success, otherwise ERROR. See the * {@link DB} class's description for a discussion of error codes. */ @Override public Status delete(String bucket, String key) { try { s3Client.deleteObject(new DeleteObjectRequest(bucket, key)); } catch (Exception e){ System.err.println("Not possible to delete the key "+key); e.printStackTrace(); return Status.ERROR; } return Status.OK; } /**
@Override public void deleteObject(String bucket, String key) throws Exception { RefCountedClient holder = client.get(); AmazonS3Client amazonS3Client = holder.useClient(); try { amazonS3Client.deleteObject(bucket, key); } finally { holder.release(); } }
@Override public void deleteObject(DeleteObjectRequest req) { req.getRequestClientOptions().appendUserAgent(USER_AGENT); // Delete the object super.deleteObject(req); // If it exists, delete the instruction file. InstructionFileId ifid = new S3ObjectId(req.getBucketName(), req.getKey()).instructionFileId(); DeleteObjectRequest instructionDeleteRequest = (DeleteObjectRequest) req.clone(); instructionDeleteRequest.withBucketName(ifid.getBucket()).withKey(ifid.getKey()); super.deleteObject(instructionDeleteRequest); }
@Override public void deleteObject(String bucketName, String key) throws AmazonClientException, AmazonServiceException { deleteObject(new DeleteObjectRequest(bucketName, key)); }
@Override public void deleteObject(DeleteObjectRequest req) { req.getRequestClientOptions().appendUserAgent(USER_AGENT); // Delete the object super.deleteObject(req); // If it exists, delete the instruction file. InstructionFileId ifid = new S3ObjectId(req.getBucketName(), req.getKey()).instructionFileId(); DeleteObjectRequest instructionDeleteRequest = (DeleteObjectRequest) req.clone(); instructionDeleteRequest.withBucketName(ifid.getBucket()).withKey(ifid.getKey()); super.deleteObject(instructionDeleteRequest); }
.withDimensions(new Dimension().withName("project").withValue(project)))); } catch (IOException | AmazonClientException e) { s3Client.deleteObject(config.getEventStoreBulkS3Bucket(), key);
public boolean deleteObject(final String key) { try { conn.deleteObject(bucketName, key); } catch (AmazonS3Exception e) { return false; } return true; }
public boolean deleteObject(final String key) { try { conn.deleteObject(bucketName, key); } catch (AmazonS3Exception e) { return false; } return true; }
@Override public boolean delete(String path) { if (StringUtils.startsWith(path, "/")) { path = path.substring(1); } if (!StringUtils.isBlank(path)) { s3.deleteObject(bucket, path); return true; } return false; }
@After public void cleanAfter() { s3.deleteObject(bucket, testFileName); }
@Override public void deleteObject(String bucketName, String key) throws AmazonClientException, AmazonServiceException { deleteObject(new DeleteObjectRequest(bucketName, key)); }
@Override public Object call() throws IOException { getS3Client().deleteObject(new DeleteObjectRequest(bucket, key)); return null; } });
/** * Delete some artifacts of a given run * @param build * @param artifact */ public void delete(Run build, FingerprintRecord record) { Destination dest = Destination.newFromRun(build, record.artifact); DeleteObjectRequest req = new DeleteObjectRequest(dest.bucketName, dest.objectName); getClient().deleteObject(req); }
@Override public void deleteObject(DeleteObjectRequest deleteObjectRequest) throws AmazonClientException, AmazonServiceException { String key = deleteObjectRequest.getKey(); LOG.debug("key {}", key); maybeFail(); registerDeleteObject(key, deleteObjectRequest.getBucketName()); super.deleteObject(deleteObjectRequest); }
@Override public Task<Void> clearState(final RemoteReference<?> reference, final Object state) { return Task.runAsync(() -> { final String bucketName = getBucketName(); final String itemId = generateDocumentId(reference); s3Connection.getS3Client().deleteObject(bucketName, itemId); }); }
@Override public void deleteObject(DeleteObjectRequest req) { req.getRequestClientOptions().appendUserAgent(USER_AGENT); // Delete the object super.deleteObject(req); // If it exists, delete the instruction file. InstructionFileId ifid = new S3ObjectId(req.getBucketName(), req.getKey()).instructionFileId(); DeleteObjectRequest instructionDeleteRequest = (DeleteObjectRequest) req.clone(); instructionDeleteRequest.withBucketName(ifid.getBucket()).withKey(ifid.getKey()); super.deleteObject(instructionDeleteRequest); }
@Override public void deleteObject(DeleteObjectRequest req) { req.getRequestClientOptions().appendUserAgent(USER_AGENT); // Delete the object super.deleteObject(req); // If it exists, delete the instruction file. InstructionFileId ifid = new S3ObjectId(req.getBucketName(), req.getKey()).instructionFileId(); DeleteObjectRequest instructionDeleteRequest = (DeleteObjectRequest) req.clone(); instructionDeleteRequest.withBucketName(ifid.getBucket()).withKey(ifid.getKey()); super.deleteObject(instructionDeleteRequest); }
@Override public boolean delete(FileData fileData) { boolean ret = true; String path = FilenameUtils.separatorsToUnix(FilenameUtils.normalize(fileData.getPath() + "/" + fileData.getFileName())); path = StringUtils.stripStart(path, "/"); try { s3Client.deleteObject(bucketName, path); } catch (AmazonS3Exception e) { ret = false; } return ret; }