-
Notifications
You must be signed in to change notification settings - Fork 914
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
Conversation
…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.
...tom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/DownloadFilter.java
Outdated
Show resolved
Hide resolved
...va/software/amazon/awssdk/transfer/s3/S3TransferManagerDownloadDirectoryIntegrationTest.java
Show resolved
Hide resolved
...tom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/DownloadFilter.java
Outdated
Show resolved
Hide resolved
...va/software/amazon/awssdk/transfer/s3/S3TransferManagerDownloadDirectoryIntegrationTest.java
Show resolved
Hide resolved
...tom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/DownloadFilter.java
Outdated
Show resolved
Hide resolved
...tom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/DownloadFilter.java
Outdated
Show resolved
Hide resolved
...nsfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/DownloadDirectoryRequest.java
Outdated
Show resolved
Hide resolved
...nsfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/DownloadDirectoryRequest.java
Show resolved
Hide resolved
...nager/src/main/java/software/amazon/awssdk/transfer/s3/internal/DownloadDirectoryHelper.java
Outdated
Show resolved
Hide resolved
* | ||
* @see DownloadFilter | ||
*/ | ||
public interface DownloadFileContext { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
SonarCloud Quality Gate failed. |
…648dffad6 Pull request: release <- staging/1d901610-baa2-43dc-9c6a-70c648dffad6
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.