Search code examples
amazon-web-servicesamazon-s3aws-java-sdk

AWS S3 Is it possible to delete the bucket file even if it is not a full file name?


I am trying to delete a file from an AWS s3 bucket. The full name of the file is "test11.mp4".

Can I delete files with only "test11" value without the extension?

For example, on Linux

rm -rf test11 * 

I want to make it work this way...

Additional edits I am using the AWS SDK for Java.


Solution

  • In the Java SDK, you can use deleteObjects() to delete multiple objects.

    See: Deleting Multiple Objects Using the AWS SDK for Java - Amazon Simple Storage Service

    However, it is not possible to specify a wildcard. The specific Key of each object to be deleted must be provided.