aws s3 ls --recursive in S3 SDK.
folks, is there recursive way to listObjects using Amazon SDK.
Is this what you are looking for?
https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/iterable/S3Objects.java
Probably. Is the Iterator iterator() I can use to iterate through all the folder/file inside a given s3 path? Does it do recursive iteration in each and every directory.
Also, I do not the iterator to iterate. Instead get the list of everything under a folder.
@sushilkumarchaudhary S3 doesn't really have the concept of a folder, it's a key/object store. That said certain tools interpret slashes in key names as folders or directories. You can limit the iteration to a specific prefix which is like limiting to a certain folder.
Since aws CLI has option to pass —reclusive to get the Recursive listing, I was just thinking if SDK has some function on same line.
Thanks for the clarifying.
Sure thing!