Skip to content

feat: add listAllObjects method to S3Template#1443

Merged
maciejwalkowiak merged 2 commits intoawspring:mainfrom
Tooa:feat/add-listallobjects-to-s3-template
Sep 14, 2025
Merged

feat: add listAllObjects method to S3Template#1443
maciejwalkowiak merged 2 commits intoawspring:mainfrom
Tooa:feat/add-listallobjects-to-s3-template

Conversation

@Tooa
Copy link
Contributor

@Tooa Tooa commented Aug 23, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This pull request adds the method listAllObjects(bucketName) to the S3Template class. The method listObjects(bucketName, prefix) was previously added in #831.

I have read the contribution guidelines below. However, this change is rather small and it didn't take a long time to implement. Its fine if you don't want the method added and close this PR. My goal was to get familiar with the setup, contributing other features for the S3Template in the future (with prior discussion).

Suggest your change in the Issues. Start writing code once the issue got approved by project maintainers.

💡 Motivation and Context

  1. It is not immediately obvious what to pass for the prefix to the listObjects(...) method to retrieve all objects of the bucket. I played around with wildcards for a while, but this didn't work out. In the end, the solution is passing the empty string as prefix
  2. findAllObjects() gives better context for the reader than listObjects("bucket", "")

Note: I decided against adding the detail as documentation to the listObjects(...) function, because of reason 2.

💚 How did you test it?

  • Command ./mvnw verify passes

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • [ ]~~ I updated reference documentation to reflect the change~~ (no documentation available)
  • [ x] All tests passing
  • [ x] No breaking changes

🔮 Next steps

For discussion if we want to remove the some from the JavaDoc here. Not sure if some is related to the 1.000 objects restriction or to the prefix filter.

Returns some or all (up to 1,000) of the objects in a bucket

@Tooa
Copy link
Contributor Author

Tooa commented Aug 23, 2025

I don't think my changes are related to the build failure in CI here.

Copy link
Contributor

@maciejwalkowiak maciejwalkowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Tooa !

@maciejwalkowiak maciejwalkowiak added this to the 4.0.0 milestone Sep 14, 2025
@maciejwalkowiak maciejwalkowiak added the component: s3 S3 integration related issue label Sep 14, 2025
@maciejwalkowiak maciejwalkowiak merged commit 31b708b into awspring:main Sep 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: s3 S3 integration related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants