|
|
|
@ -87,6 +87,15 @@ public class S3ResourceRepository extends BaseResourceRepository {
|
|
|
|
|
ListObjectsRequest listObjectsRequest = new ListObjectsRequest().withBucketName(bucket) |
|
|
|
|
.withPrefix(dir).withDelimiter(DELIMITER); |
|
|
|
|
ObjectListing objectListing = s3.listObjects(listObjectsRequest); |
|
|
|
|
collectFileEntry(result, objectListing); |
|
|
|
|
while (objectListing.isTruncated()) { |
|
|
|
|
objectListing = s3.listNextBatchOfObjects(objectListing); |
|
|
|
|
collectFileEntry(result, objectListing); |
|
|
|
|
} |
|
|
|
|
return result.toArray(new FineFileEntry[0]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void collectFileEntry(List<FineFileEntry> result, ObjectListing objectListing) { |
|
|
|
|
for (S3ObjectSummary summary : objectListing.getObjectSummaries()) { |
|
|
|
|
String key = summary.getKey(); |
|
|
|
|
if (!key.endsWith(DELIMITER)) { |
|
|
|
@ -98,8 +107,6 @@ public class S3ResourceRepository extends BaseResourceRepository {
|
|
|
|
|
entry.setDirectory(true); |
|
|
|
|
result.add(entry); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return result.toArray(new FineFileEntry[0]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|