optimized object list
This commit is contained in:
parent
a776dfc5e4
commit
3a0dd2c461
3 changed files with 37 additions and 15 deletions
17
.idea/deploymentTargetDropDown.xml
Normal file
17
.idea/deploymentTargetDropDown.xml
Normal 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>
|
|
@ -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) {
|
||||
for (S3ObjectSummary os : objects) {
|
||||
totalSize += os.getSize();
|
||||
totalItems++;
|
||||
}
|
||||
while (result.isTruncated()) {
|
||||
result = s3client.listNextBatchOfObjects (result);
|
||||
objects = result.getObjectSummaries();
|
||||
} else {
|
||||
nextbatch = true;
|
||||
}
|
||||
for (S3ObjectSummary os : objects) {
|
||||
totalSize += os.getSize();
|
||||
totalItems++;
|
||||
|
|
|
@ -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) {
|
||||
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();
|
||||
} else {
|
||||
nextbatch = true;
|
||||
}
|
||||
for (S3ObjectSummary os : objects) {
|
||||
filename = os.getKey().split("/");
|
||||
if (filename.length == treelevel+1) {
|
||||
|
|
Loading…
Reference in a new issue