S3UploadService implements UploadService { @Override public List<MultipartUpload> listUploads() { List<MultipartUpload> result = null; try { if (bucketNamingService.isPartitioned()) { result = new ArrayList<MultipartUpload>(); for (int i = 0; i < bucketNamingService.getBucketPoolSize(); i++) { val actualBucketName = bucketNamingService.constructBucketName(bucketNamingService.getBaseObjectBucketName(), i); val request = new ListMultipartUploadsRequest(actualBucketName); val response = s3Client.listMultipartUploads(request); result.addAll(response.getMultipartUploads()); } } else { val request = new ListMultipartUploadsRequest(bucketNamingService.getBaseObjectBucketName()); val response = s3Client.listMultipartUploads(request); result = response.getMultipartUploads(); } return result; } catch (AmazonServiceException e) { log.error("Failed to list uploads on partition : ", e); throw new RetryableException(e); } }  @Override ObjectSpecification initiateUpload(String objectId, long fileSize, String md5, boolean overwrite); @Override boolean exists(@NonNull String objectId); @Override @SneakyThrows void finalizeUploadPart(String objectId, String uploadId, int partNumber, String md5, String eTag); @Override void finalizeUpload(String objectId, String uploadId); @Override String getUploadId(String objectId); @Override ObjectMetadata getObjectMetadata(String objectId); @Override UploadProgress getUploadStatus(String objectId, String uploadId, long fileSize); @Override void cancelUploads(); @Override void cancelUpload(String objectId, String uploadId); @Override void recover(String objectId, long fileSize); @Override void deletePart(String objectId, String uploadId, int partNumber); @Override List<MultipartUpload> listUploads();  }
@Test public void testListUploads() { val uploadService = Tests.createUploadService(); for (val upload : uploadService.listUploads()) { val objectId = ObjectKeys.getObjectId(Tests.DATA_DIR, upload.getKey()); System.out.println("key:" + upload.getKey() + ", uploadId: " + upload.getUploadId() + ", initiated: " + upload.getInitiated() + ", objectId: " + objectId); } }