You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/08/04 14:13:28 UTC
git commit: updated refs/heads/4.5 to 58c6a8d
Repository: cloudstack
Updated Branches:
refs/heads/4.5 2ed9539c2 -> 58c6a8d1a
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 <ro...@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
Commit: 58c6a8d1a38f65dc472a6c35ede2f01e608a1a7a
Parents: 2ed9539
Author: Boris Schrijver <bo...@pcextreme.nl>
Authored: Mon Aug 3 17:10:05 2015 +0200
Committer: Rohit Yadav <ro...@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()) {