@Override public void deleteObject(String bucketName, String key) throws SdkClientException, 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); }
/** * Constructs a new * {@link DeleteObjectRequest}, * specifying the object's bucket name and key. * * @param bucketName * The name of the Amazon S3 bucket containing the object to * delete. * @param key * The key of the object to delete. */ public DeleteObjectRequest(String bucketName, String key) { setBucketName(bucketName); setKey(key); }
@Override public void deleteObject(DeleteObjectRequest deleteObjectRequest) throws SdkClientException, AmazonServiceException { deleteObjectRequest = beforeClientExecution(deleteObjectRequest); rejectNull(deleteObjectRequest, "The delete object request must be specified when deleting an object"); rejectNull(deleteObjectRequest.getBucketName(), "The bucket name must be specified when deleting an object"); rejectNull(deleteObjectRequest.getKey(), "The key must be specified when deleting an object"); Request<DeleteObjectRequest> request = createRequest(deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey(), deleteObjectRequest, HttpMethodName.DELETE); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteObject"); invoke(request, voidResponseHandler, deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey()); }
/** * Creates a delete request to delete an instruction file in S3. * * @param request The delete request for the original object to be deleted * from S3. * @return A delete request to delete an instruction file in S3. */ public static DeleteObjectRequest createInstructionDeleteObjectRequest( DeleteObjectRequest request) { return new DeleteObjectRequest(request.getBucketName(), request.getKey() + INSTRUCTION_SUFFIX); }
/** * Sets the name of the Amazon S3 bucket containing the object to delete * and returns this object, enabling additional method calls to be chained * together. * * @param bucketName * The name of the Amazon S3 bucket containing the object to * delete. * * @return The updated {@link DeleteObjectRequest} * object, enabling additional method * calls to be chained together. */ public DeleteObjectRequest withBucketName(String bucketName) { setBucketName(bucketName); return this; }
/** * Creates a delete request to delete an instruction file in S3. * * @param request The delete request for the original object to be deleted * from S3. * @return A delete request to delete an instruction file in S3. */ public static DeleteObjectRequest createInstructionDeleteObjectRequest( DeleteObjectRequest request) { return new DeleteObjectRequest(request.getBucketName(), request.getKey() + INSTRUCTION_SUFFIX); }
@Override public void deleteObject(DeleteObjectRequest deleteObjectRequest) throws AmazonClientException, AmazonServiceException { assertParameterNotNull(deleteObjectRequest, "The delete object request must be specified when deleting an object"); assertParameterNotNull(deleteObjectRequest.getBucketName(), "The bucket name must be specified when deleting an object"); assertParameterNotNull(deleteObjectRequest.getKey(), "The key must be specified when deleting an object"); final Request<DeleteObjectRequest> request = createRequest(deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey(), deleteObjectRequest, HttpMethodName.DELETE); invoke(request, voidResponseHandler, deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey()); }
/** * Sets the name of the Amazon S3 bucket containing the object to delete * and returns this object, enabling additional method calls to be chained * together. * * @param bucketName * The name of the Amazon S3 bucket containing the object to * delete. * * @return The updated {@link DeleteObjectRequest} * object, enabling additional method * calls to be chained together. */ public DeleteObjectRequest withBucketName(String bucketName) { setBucketName(bucketName); return this; }
@Override public void deleteObject(String bucketName, String key) throws SdkClientException, 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); }
@Override public void deleteObject(DeleteObjectRequest deleteObjectRequest) throws AmazonClientException, AmazonServiceException { assertParameterNotNull(deleteObjectRequest, "The delete object request must be specified when deleting an object"); assertParameterNotNull(deleteObjectRequest.getBucketName(), "The bucket name must be specified when deleting an object"); assertParameterNotNull(deleteObjectRequest.getKey(), "The key must be specified when deleting an object"); final Request<DeleteObjectRequest> request = createRequest(deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey(), deleteObjectRequest, HttpMethodName.DELETE); invoke(request, voidResponseHandler, deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey()); }
/** * Constructs a new * {@link DeleteObjectRequest}, * specifying the object's bucket name and key. * * @param bucketName * The name of the Amazon S3 bucket containing the object to * delete. * @param key * The key of the object to delete. */ public DeleteObjectRequest(String bucketName, String key) { setBucketName(bucketName); setKey(key); }
/** * Sets the name of the Amazon S3 bucket containing the object to delete * and returns this object, enabling additional method calls to be chained * together. * * @param bucketName * The name of the Amazon S3 bucket containing the object to * delete. * * @return The updated {@link DeleteObjectRequest} * object, enabling additional method * calls to be chained together. */ public DeleteObjectRequest withBucketName(String bucketName) { setBucketName(bucketName); return this; }
/** * 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(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 deleteObjectRequest) throws SdkClientException, AmazonServiceException { deleteObjectRequest = beforeClientExecution(deleteObjectRequest); rejectNull(deleteObjectRequest, "The delete object request must be specified when deleting an object"); rejectNull(deleteObjectRequest.getBucketName(), "The bucket name must be specified when deleting an object"); rejectNull(deleteObjectRequest.getKey(), "The key must be specified when deleting an object"); Request<DeleteObjectRequest> request = createRequest(deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey(), deleteObjectRequest, HttpMethodName.DELETE); invoke(request, voidResponseHandler, deleteObjectRequest.getBucketName(), deleteObjectRequest.getKey()); }
/** * Constructs a new * {@link DeleteObjectRequest}, * specifying the object's bucket name and key. * * @param bucketName * The name of the Amazon S3 bucket containing the object to * delete. * @param key * The key of the object to delete. */ public DeleteObjectRequest(String bucketName, String key) { setBucketName(bucketName); setKey(key); }
/** * Sets the name of the Amazon S3 bucket containing the object to delete * and returns this object, enabling additional method calls to be chained * together. * * @param bucketName * The name of the Amazon S3 bucket containing the object to * delete. * * @return The updated {@link DeleteObjectRequest} * object, enabling additional method * calls to be chained together. */ public DeleteObjectRequest withBucketName(String bucketName) { setBucketName(bucketName); return this; }
@Override public void delete( UUID appId, Entity entity ) throws Exception { getS3Client().deleteObject(new DeleteObjectRequest(bucketName, AssetUtils.buildAssetKey( appId, entity ))); } }