S3Service { public List<String> listS3Objects(final String bucketName, final String prefix) { final List<String> s3Objects = Lists.newArrayList(); try { log.debug("Listing objects"); final ListObjectsRequest listObjectsRequest = new ListObjectsRequest() .withDelimiter("/") .withBucketName(bucketName) .withPrefix(prefix); ObjectListing objectListing; do { objectListing = s3client.listObjects(listObjectsRequest); for (final S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) { if (objectSummary.getKey().equals(prefix)) { continue; } s3Objects.add(objectSummary.getKey()); } listObjectsRequest.setMarker(objectListing.getNextMarker()); } while (objectListing.isTruncated()); } catch (final AmazonServiceException e) { log.error("Error Message: " + e.getMessage()); } return s3Objects; } S3Service(@Value("${fullstop.processor.properties.s3Region:#{null}}") String s3Region); String writeToS3(final String accountId, final String region, final Date instanceBootTime,
                            final String logData, final String logType, final String instanceId); void putObjectToS3(final String bucket, final String fileName, final String keyName,
                              final ObjectMetadata metadata, final InputStream stream); List<String> listCommonPrefixesS3Objects(final String bucketName, final String prefix); List<String> listS3Objects(final String bucketName, final String prefix); String downloadObject(final String bucketName, final String key);  }
@Test public void testListObjects() throws Exception { final List<String> result = service.listS3Objects("an-s3-bucket", "111222333444/eu-west-1/2016/01/15/i-62f41fea-2016-01-15T15:59:54.000Z/"); log.info("{}", result); }