cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/7] git commit: updated refs/heads/4.5-samlfixes to 69f39d5
Date Sat, 08 Aug 2015 19:06:57 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5-samlfixes 6a1430c11 -> 69f39d533 (forced update)


CLOUDSTACK-8703: Fixed issue when listing directory on S3, it would only return objectSummaries
when the anwser from the S3 System was truncated.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #651


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/58c6a8d1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/58c6a8d1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/58c6a8d1

Branch: refs/heads/4.5-samlfixes
Commit: 58c6a8d1a38f65dc472a6c35ede2f01e608a1a7a
Parents: 2ed9539
Author: Boris Schrijver <boris@pcextreme.nl>
Authored: Mon Aug 3 17:10:05 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Aug 4 17:42:21 2015 +0530

----------------------------------------------------------------------
 utils/src/com/cloud/utils/S3Utils.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58c6a8d1/utils/src/com/cloud/utils/S3Utils.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/S3Utils.java b/utils/src/com/cloud/utils/S3Utils.java
index ae7a453..532b2eb 100644
--- a/utils/src/com/cloud/utils/S3Utils.java
+++ b/utils/src/com/cloud/utils/S3Utils.java
@@ -343,10 +343,15 @@ public final class S3Utils {
         ListObjectsRequest listObjectsRequest = new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory
+ SEPARATOR);
 
         ObjectListing ol = client.listObjects(listObjectsRequest);
-        while (ol != null && ol.isTruncated()) {
+        if(ol.isTruncated()) {
+            do {
+                objects.addAll(ol.getObjectSummaries());
+                listObjectsRequest.setMarker(ol.getNextMarker());
+                ol = client.listObjects(listObjectsRequest);
+            } while (ol.isTruncated());
+        }
+        else {
             objects.addAll(ol.getObjectSummaries());
-            listObjectsRequest.setMarker(ol.getNextMarker());
-            ol = client.listObjects(listObjectsRequest);
         }
 
         if (objects.isEmpty()) {


Mime
View raw message