GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CLOUDSTACK-8703: Fixed issue when listing directory on S3, it would o… · enterdevstudio/cloudstack@58c6a8d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • utils/src/com/cloud/utils
    • S3Utils.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎utils/src/com/cloud/utils/S3Utils.java‎

Copy file name to clipboardExpand all lines: utils/src/com/cloud/utils/S3Utils.java
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,15 @@ private static List<S3ObjectSummary> listDirectory(final String bucketName, fina
343343
ListObjectsRequest listObjectsRequest = new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory + SEPARATOR);
344344

345345
ObjectListing ol = client.listObjects(listObjectsRequest);
346-
while (ol != null && ol.isTruncated()) {
346+
if(ol.isTruncated()) {
347+
do {
348+
objects.addAll(ol.getObjectSummaries());
349+
listObjectsRequest.setMarker(ol.getNextMarker());
350+
ol = client.listObjects(listObjectsRequest);
351+
} while (ol.isTruncated());
352+
}
353+
else {
347354
objects.addAll(ol.getObjectSummaries());
348-
listObjectsRequest.setMarker(ol.getNextMarker());
349-
ol = client.listObjects(listObjectsRequest);
350355
}
351356

352357
if (objects.isEmpty()) {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.