optimized object list

This commit is contained in:
Page Asgardius 2022-10-12 12:36:22 -07:00
parent a776dfc5e4
commit 3a0dd2c461
3 changed files with 37 additions and 15 deletions

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/4.7_WXGA_API_31.avd" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-10-12T19:31:01.504763Z" />
</component>
</project>

View file

@ -92,14 +92,13 @@ public class ObjectInfo extends AppCompatActivity {
}
ObjectListing result = s3client.listObjects(orequest);
List<S3ObjectSummary> objects = result.getObjectSummaries();
boolean nextbatch = false;
while (result.isTruncated() || !nextbatch) {
if (nextbatch) {
result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries();
} else {
nextbatch = true;
}
for (S3ObjectSummary os : objects) {
totalSize += os.getSize();
totalItems++;
}
while (result.isTruncated()) {
result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries();
for (S3ObjectSummary os : objects) {
totalSize += os.getSize();
totalItems++;

View file

@ -115,14 +115,20 @@ public class ObjectSelect extends AppCompatActivity {
//System.out.println("Buckets:");
//int i=0;
List<S3ObjectSummary> objects = result.getObjectSummaries();
boolean nextbatch = false;
while (result.isTruncated() || !nextbatch) {
if (nextbatch) {
result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries();
} else {
nextbatch = true;
for (S3ObjectSummary os : objects) {
filename = os.getKey().split("/");
if (filename.length == treelevel+1) {
object.add(filename[treelevel]);
}
else {
object.add(filename[treelevel]+"/");
}
//i++;
}
while (result.isTruncated()) {
result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries();
for (S3ObjectSummary os : objects) {
filename = os.getKey().split("/");
if (filename.length == treelevel+1) {