optimized object list

This commit is contained in:
Page Asgardius 2022-10-12 12:45:10 -07:00
parent 3a0dd2c461
commit 7bf2e471fd
2 changed files with 12 additions and 16 deletions

View file

@ -225,14 +225,12 @@ public class BucketSelect extends AppCompatActivity {
ObjectListing result = s3client.listObjects(orequest); ObjectListing result = s3client.listObjects(orequest);
ArrayList<String> objectl = new ArrayList<String>(); ArrayList<String> objectl = new ArrayList<String>();
List<S3ObjectSummary> objects = result.getObjectSummaries(); List<S3ObjectSummary> objects = result.getObjectSummaries();
boolean nextbatch = false; for (S3ObjectSummary os : objects) {
while (result.isTruncated() || !nextbatch) { objectl.add(os.getKey());
if (nextbatch) { }
while (result.isTruncated()) {
result = s3client.listNextBatchOfObjects (result); result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries(); objects = result.getObjectSummaries();
} else {
nextbatch = true;
}
for (S3ObjectSummary os : objects) { for (S3ObjectSummary os : objects) {
objectl.add(os.getKey()); objectl.add(os.getKey());

View file

@ -546,14 +546,12 @@ public class ObjectSelect extends AppCompatActivity {
ObjectListing result = s3client.listObjects(orequest); ObjectListing result = s3client.listObjects(orequest);
ArrayList<String> objectl = new ArrayList<String>(); ArrayList<String> objectl = new ArrayList<String>();
List<S3ObjectSummary> objects = result.getObjectSummaries(); List<S3ObjectSummary> objects = result.getObjectSummaries();
boolean nextbatch = false; for (S3ObjectSummary os : objects) {
while (result.isTruncated() || !nextbatch) { objectl.add(os.getKey());
if (nextbatch) { }
while (result.isTruncated()) {
result = s3client.listNextBatchOfObjects (result); result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries(); objects = result.getObjectSummaries();
} else {
nextbatch = true;
}
for (S3ObjectSummary os : objects) { for (S3ObjectSummary os : objects) {
objectl.add(os.getKey()); objectl.add(os.getKey());