curena
12/7/2015 - 4:38 PM

AWS list only direct children of a subfolder.

AWS list only direct children of a subfolder.

AmazonS3 s3 = new AmazonS3Client(new AWSConfiguration());
ListObjectsRequest listObjectRequest = new ListObjectsRequest().
    withBucketName(AWSConfiguration.BUCKET).
    withPrefix(prefix).
    withDelimiter("/");
ObjectListing objectListing = s3.listObjects(listObjectRequest).getCommonPrefixes();