I am writing a java program to add/delete/modify files in an S3 bucket.If I use
client.deleteObject(bucketName, key)
the key if it exists gets deleted and if that key is invalid, nothing happens.
Is there any way to get acknowledgement of deleteObject() and putObject() so that one can know that an add or delete option has successfully been done? This is definitely required in deleteObject() where I want to confirm if the given key exists or not.
First of all the AWS SDK is pretty good documented. That is you should probably consult the JavaDoc first.
Regarding your question, the methods AmazonS3.putObject(PutObjectRequest) and AmazonS3.deleteObjects(DeleteObjectsRequest) return a PutObjectResult or a DeleteObjectsResult. These objects contain the wanted information...