spring-cloud-aws icon indicating copy to clipboard operation
spring-cloud-aws copied to clipboard

Support for deleting of resources

Open ptahchiev opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. I'm trying to delete a resource in my S3 bucket using the spring-cloud AWS API. Seems like it is impossible: https://stackoverflow.com/questions/51304075/how-to-delete-file-from-s3-using-spring-cloud-aws

Describe the solution you'd like Can you please provide support for deleting files on S3? Also APIs for setting ACL permissions, creating a folder, listing files in a folder and last but not least resolving media type of some file is necessary.

Describe alternatives you've considered At the moment I'm using commons-vfs connector to S3 and it works. But I want to migrate to spring-cloud. This issue is a blocker for me.

ptahchiev avatar Jul 09 '20 08:07 ptahchiev

I wonder if there could be an S3Template type object that allows other operations since Resource is read only.

spencergibb avatar Jul 09 '20 16:07 spencergibb

There could be a S3Template but I am wondering if it would bring any benefits over using directly AmazonS3Client. @ptahchiev do you have some ideas?

maciejwalkowiak avatar Jul 23 '20 22:07 maciejwalkowiak

using the AmazonS3Client will require to use the classes for request and response for every operation we want to perform. Instead S3Template will be an abstraction where just s3Template.create(bucket) can do the job. For the title I can guess something like s3Template.delete(bucket, resource) can be useful.

Also, with a configuration properties we can set region for the specific bucket and also transfer acceleration.

eddumelendez avatar Jul 29 '20 23:07 eddumelendez

The main benefit from a Spring-native client is a consistent API. Currently, the ResourceLoader operates on URLs, while the S3 library operates on bucket/path string pairs - translating between these is not a big deal, but annoying.

jasonab avatar Oct 05 '21 18:10 jasonab