Skip to content

Add support for filtering objects as part of S3 Transfer Manager's DownloadDirectory API #3042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 22, 2022

Conversation

Bennett-Lynch
Copy link
Contributor

@Bennett-Lynch Bennett-Lynch commented Feb 18, 2022

This allows users to specify a filter that will be used to evaluate which objects should be downloaded from the target S3 directory.

You can use a filter, for example, to only download objects of a given size, of a given file extension, of a given last-modified date, etc.

By default, if no filter is specified, all objects will be downloaded.

In the future, this may allow us to more easily support "sync" functionality, but support for that feature is out of scope currently.

…wnloadDirectory API

This allows users to specify a filter that will be used to evaluate
which objects should be downloaded from the target S3 directory.

You can use a filter, for example, to only download objects of a given
size, of a given file extension, of a given last-modified date, etc. See
`DownloadFilter` for some ready-made implementations.

By default, if no filter is specified, all objects will be downloaded.
@Bennett-Lynch Bennett-Lynch requested a review from a team as a code owner February 18, 2022 20:01
*
* @see DownloadFilter
*/
public interface DownloadFileContext {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an interface, primarily in order to hide the constructor as an internal-API.

Alternatively, can not use an interface, but would need to expose a proper builder. Let me know if any preference.

/**
* @return A description of the remote S3 object
*/
S3Object source();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opted to call this source so it reads symmetrical with destination.

/**
* @return A path representing the local file destination
*/
Path destination();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now I'm proposing not including the GetObjectRequest here because I think it's unlikely to be useful. In the event we wish to add it in the future, it would be safe to add.

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

62.1% 62.1% Coverage
0.0% 0.0% Duplication

@Bennett-Lynch Bennett-Lynch merged commit 5d39aa0 into aws:master Feb 22, 2022
aws-sdk-java-automation added a commit that referenced this pull request May 22, 2024
…648dffad6

Pull request: release <- staging/1d901610-baa2-43dc-9c6a-70c648dffad6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants