@Test void listObjects() { amazonS3.putObject(bucket, key1, content); amazonS3.putObject(bucket, key2, content); List<S3ObjectSummary> result = s3Client.listObjects(bucket, keyRoot); assertThat(result.size()).isEqualTo(2); assertThat(result.get(0).getBucketName()).isEqualTo(bucket); assertThat(result.get(0).getKey()).isEqualTo(key1); assertThat(result.get(1).getBucketName()).isEqualTo(bucket); assertThat(result.get(1).getKey()).isEqualTo(key2); }
List<S3ObjectSummary> listObjects(String bucket, String key) { List<S3ObjectSummary> objectSummaries = new ArrayList<>(); ListObjectsV2Result listObjectsV2Result; String continuationToken = null; do { ListObjectsV2Request request = new ListObjectsV2Request() .withBucketName(bucket) .withPrefix(key) .withEncodingType("url") .withContinuationToken(continuationToken); listObjectsV2Result = amazonS3.listObjectsV2(request); objectSummaries.addAll(listObjectsV2Result.getObjectSummaries()); continuationToken = listObjectsV2Result.getNextContinuationToken(); } while (listObjectsV2Result.isTruncated()); return objectSummaries; }
S3Client { List<S3ObjectSummary> listObjects(String bucket, String key) { List<S3ObjectSummary> objectSummaries = new ArrayList<>(); ListObjectsV2Result listObjectsV2Result; String continuationToken = null; do { ListObjectsV2Request request = new ListObjectsV2Request() .withBucketName(bucket) .withPrefix(key) .withEncodingType("url") .withContinuationToken(continuationToken); listObjectsV2Result = amazonS3.listObjectsV2(request); objectSummaries.addAll(listObjectsV2Result.getObjectSummaries()); continuationToken = listObjectsV2Result.getNextContinuationToken(); } while (listObjectsV2Result.isTruncated()); return objectSummaries; } }
S3Client { List<S3ObjectSummary> listObjects(String bucket, String key) { List<S3ObjectSummary> objectSummaries = new ArrayList<>(); ListObjectsV2Result listObjectsV2Result; String continuationToken = null; do { ListObjectsV2Request request = new ListObjectsV2Request() .withBucketName(bucket) .withPrefix(key) .withEncodingType("url") .withContinuationToken(continuationToken); listObjectsV2Result = amazonS3.listObjectsV2(request); objectSummaries.addAll(listObjectsV2Result.getObjectSummaries()); continuationToken = listObjectsV2Result.getNextContinuationToken(); } while (listObjectsV2Result.isTruncated()); return objectSummaries; } S3Client(AmazonS3 amazonS3, boolean dryRunEnabled); }
S3Client { List<S3ObjectSummary> listObjects(String bucket, String key) { List<S3ObjectSummary> objectSummaries = new ArrayList<>(); ListObjectsV2Result listObjectsV2Result; String continuationToken = null; do { ListObjectsV2Request request = new ListObjectsV2Request() .withBucketName(bucket) .withPrefix(key) .withEncodingType("url") .withContinuationToken(continuationToken); listObjectsV2Result = amazonS3.listObjectsV2(request); objectSummaries.addAll(listObjectsV2Result.getObjectSummaries()); continuationToken = listObjectsV2Result.getNextContinuationToken(); } while (listObjectsV2Result.isTruncated()); return objectSummaries; } S3Client(AmazonS3 amazonS3, boolean dryRunEnabled);  }
S3Client { List<S3ObjectSummary> listObjects(String bucket, String key) { List<S3ObjectSummary> objectSummaries = new ArrayList<>(); ListObjectsV2Result listObjectsV2Result; String continuationToken = null; do { ListObjectsV2Request request = new ListObjectsV2Request() .withBucketName(bucket) .withPrefix(key) .withEncodingType("url") .withContinuationToken(continuationToken); listObjectsV2Result = amazonS3.listObjectsV2(request); objectSummaries.addAll(listObjectsV2Result.getObjectSummaries()); continuationToken = listObjectsV2Result.getNextContinuationToken(); } while (listObjectsV2Result.isTruncated()); return objectSummaries; } S3Client(AmazonS3 amazonS3, boolean dryRunEnabled);   }