Using the aws cli I can send a --query
to return only the objects since LastModified:
aws s3api list-objects --profile <profile> --bucket <bucket> --query 'Contents[?LastModified>=`2017-01-19`][]'
Works great, returns only objects >=
the date.
I'm trying to translate this to the Java SDK with something like this:
ListObjectsV2Request req = new ListObjectsV2Request();
req.putCustomQueryParameter("LastModified>=`2017-01-19`", null);
I've tried a large number of variations on the both the query and parameter strings without any luck- the query always returns all objects. So two questions:
Thanks in advance.
This isn't possible in the way you envision it.
The cli is actually listing all the objects and filtering them locally. The API (which is what the cli, SDKs, and console all use) doesn't support such a query.