test release

This commit is contained in:
Page Asgardius 2022-10-12 13:35:20 -07:00
parent ff42c57e78
commit 03e7dc5988
2 changed files with 20 additions and 15 deletions

View file

@ -228,21 +228,23 @@ public class BucketSelect extends AppCompatActivity {
for (S3ObjectSummary os : objects) { for (S3ObjectSummary os : objects) {
objectl.add(os.getKey()); objectl.add(os.getKey());
} }
while (result.isTruncated()) {
result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries();
for (S3ObjectSummary os : objects) {
objectl.add(os.getKey());
//i++;
}
}
//System.out.println(object);
if (objectl.size() >= 1) { if (objectl.size() >= 1) {
DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(bucket).withKeys(objectl.toArray(new String[0])); DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(bucket).withKeys(objectl.toArray(new String[0]));
s3client.deleteObjects(deleteObjectsRequest); s3client.deleteObjects(deleteObjectsRequest);
} }
while (result.isTruncated()) {
objectl = new ArrayList<String>();
result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries();
for (S3ObjectSummary os : objects) {
objectl.add(os.getKey());
//i++;
}
DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(bucket).withKeys(objectl.toArray(new String[0]));
s3client.deleteObjects(deleteObjectsRequest);
}
//System.out.println("bucket items: " + objectl.size());
s3client.deleteBucket(bucket); s3client.deleteBucket(bucket);
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {

View file

@ -549,20 +549,23 @@ public class ObjectSelect extends AppCompatActivity {
for (S3ObjectSummary os : objects) { for (S3ObjectSummary os : objects) {
objectl.add(os.getKey()); objectl.add(os.getKey());
} }
if (objectl.size() >= 1) {
DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(bucket).withKeys(objectl.toArray(new String[0]));
s3client.deleteObjects(deleteObjectsRequest);
}
while (result.isTruncated()) { while (result.isTruncated()) {
objectl = new ArrayList<String>();
result = s3client.listNextBatchOfObjects (result); result = s3client.listNextBatchOfObjects (result);
objects = result.getObjectSummaries(); objects = result.getObjectSummaries();
for (S3ObjectSummary os : objects) { for (S3ObjectSummary os : objects) {
objectl.add(os.getKey()); objectl.add(os.getKey());
//i++; //i++;
} }
}
//System.out.println(object);
DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(bucket).withKeys(objectl.toArray(new String[0])); DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(bucket).withKeys(objectl.toArray(new String[0]));
s3client.deleteObjects(deleteObjectsRequest); s3client.deleteObjects(deleteObjectsRequest);
}
} else { } else {
DeleteObjectRequest deleteObjectRequest = new DeleteObjectRequest(bucket, object); DeleteObjectRequest deleteObjectRequest = new DeleteObjectRequest(bucket, object);
s3client.deleteObject(deleteObjectRequest); s3client.deleteObject(deleteObjectRequest);