diff --git a/aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/S3Bucket.java b/aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/S3Bucket.java index 333542abae..574cef26be 100644 --- a/aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/S3Bucket.java +++ b/aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/S3Bucket.java @@ -26,8 +26,9 @@ package org.jclouds.aws.s3.domain; import static com.google.common.base.Preconditions.checkNotNull; import org.joda.time.DateTime; -import java.util.HashSet; import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; /** * A container that provides namespace, access control and aggregation of @@ -205,8 +206,8 @@ public class S3Bucket { public static final S3Bucket NOT_FOUND = new S3Bucket("NOT_FOUND"); - private Set objects = new HashSet(); - private Set commonPrefixes = new HashSet(); + private SortedSet objects = new TreeSet(); + private SortedSet commonPrefixes = new TreeSet(); private String prefix; private String marker; private String delimiter; @@ -230,11 +231,11 @@ public class S3Bucket { /** * @see org.jclouds.aws.s3.S3Connection#listBucket(String) */ - public Set getContents() { + public SortedSet getContents() { return objects; } - public void setContents(Set objects) { + public void setContents(SortedSet objects) { this.objects = objects; } @@ -253,7 +254,7 @@ public class S3Bucket { return metadata; } - public void setCommonPrefixes(Set commonPrefixes) { + public void setCommonPrefixes(SortedSet commonPrefixes) { this.commonPrefixes = commonPrefixes; } @@ -272,7 +273,7 @@ public class S3Bucket { * * @see org.jclouds.aws.s3.commands.options.ListBucketOptions#getPrefix() */ - public Set getCommonPrefixes() { + public SortedSet getCommonPrefixes() { return commonPrefixes; }