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

List objects using S3Template

Open ooraini opened this issue 1 year ago • 3 comments

Type: Feature

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I can almost exclusively use the S3Template class, but I sometimes need to list objects with a certain prefix. Maybe this use case is common enough to be placed in S3Template.

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

ooraini avatar Apr 18 '23 00:04 ooraini

@ooraini I am guessing you mean putting the functionality described here https://docs.awspring.io/spring-cloud-aws/docs/3.0.0-SNAPSHOT/reference/html/index.html#searching-resources into S3Template? I think it makes sense. You're welcome to submit a PR!

maciejwalkowiak avatar Apr 18 '23 03:04 maciejwalkowiak

@maciejwalkowiak Oh wow, I didn't notice S3PathMatchingResourcePatternResolver. I guess now I'm not sure if it's worth it to introduce a new method. I guess if we do, then we shouldn't just expose S3PathMatchingResourcePatternResolver as is. In the spirit of making the common case easy, we might add the following method to S3Template:

List<S3Resource> listObjects(String bucket, String prefix) {}

Not as capable as S3PathMatchingResourcePatternResolver and no pagination support, if you need either, use S3Client or S3PathMatchingResourcePatternResolver. What do you think?

ooraini avatar Apr 18 '23 03:04 ooraini

Sounds good!

maciejwalkowiak avatar Apr 18 '23 05:04 maciejwalkowiak