optimized object list
This commit is contained in:
parent
3a0dd2c461
commit
7bf2e471fd
2 changed files with 12 additions and 16 deletions
|
@ -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) {
|
}
|
||||||
result = s3client.listNextBatchOfObjects (result);
|
while (result.isTruncated()) {
|
||||||
objects = result.getObjectSummaries();
|
result = s3client.listNextBatchOfObjects (result);
|
||||||
} else {
|
objects = result.getObjectSummaries();
|
||||||
nextbatch = true;
|
|
||||||
}
|
|
||||||
for (S3ObjectSummary os : objects) {
|
for (S3ObjectSummary os : objects) {
|
||||||
objectl.add(os.getKey());
|
objectl.add(os.getKey());
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
}
|
||||||
result = s3client.listNextBatchOfObjects (result);
|
while (result.isTruncated()) {
|
||||||
objects = result.getObjectSummaries();
|
result = s3client.listNextBatchOfObjects (result);
|
||||||
} else {
|
objects = result.getObjectSummaries();
|
||||||
nextbatch = true;
|
|
||||||
}
|
|
||||||
for (S3ObjectSummary os : objects) {
|
for (S3ObjectSummary os : objects) {
|
||||||
objectl.add(os.getKey());
|
objectl.add(os.getKey());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue