org.jclouds.s3.domain.internal
Class ListBucketResponseImpl

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<E>
              extended by java.util.LinkedHashSet<ObjectMetadata>
                  extended by org.jclouds.s3.domain.internal.ListBucketResponseImpl
All Implemented Interfaces:
Serializable, Cloneable, Iterable<ObjectMetadata>, Collection<ObjectMetadata>, Set<ObjectMetadata>, ListBucketResponse

public class ListBucketResponseImpl
extends LinkedHashSet<ObjectMetadata>
implements ListBucketResponse

Author:
Adrian Cole
See Also:
Serialized Form

Field Summary
protected  Set<String> commonPrefixes
           
protected  String delimiter
           
protected  String marker
           
protected  int maxKeys
           
protected  String name
           
protected  String nextMarker
           
protected  String prefix
           
protected  boolean truncated
           
 
Constructor Summary
ListBucketResponseImpl(String name, Iterable<ObjectMetadata> contents, String prefix, String marker, String nextMarker, int maxKeys, String delimiter, boolean isTruncated, Set<String> commonPrefixes)
           
 
Method Summary
 boolean equals(Object obj)
           
 Set<String> getCommonPrefixes()
          Example:

if the following keys are in the bucket

a/1/a
a/1/b
a/2/a
a/2/b

and prefix is set to a/ and delimiter is set to / then commonprefixes would return 1,2

 String getDelimiter()
          Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection.
 String getMarker()
          
 int getMaxKeys()
          The maximum number of keys you'd like to see in the response body.
 String getName()
          name of the Bucket
 String getNextMarker()
          Indicates where in the bucket to begin listing.
 String getPrefix()
          Limits the response to keys which begin with the indicated prefix.
 int hashCode()
           
 boolean isTruncated()
          There are more then maxKeys available
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

name

protected final String name

prefix

protected final String prefix

maxKeys

protected final int maxKeys

delimiter

protected final String delimiter

marker

protected final String marker

nextMarker

protected final String nextMarker

commonPrefixes

protected final Set<String> commonPrefixes

truncated

protected final boolean truncated
Constructor Detail

ListBucketResponseImpl

public ListBucketResponseImpl(String name,
                              Iterable<ObjectMetadata> contents,
                              String prefix,
                              String marker,
                              String nextMarker,
                              int maxKeys,
                              String delimiter,
                              boolean isTruncated,
                              Set<String> commonPrefixes)
Method Detail

getCommonPrefixes

public Set<String> getCommonPrefixes()
Example:

if the following keys are in the bucket

a/1/a
a/1/b
a/2/a
a/2/b

and prefix is set to a/ and delimiter is set to / then commonprefixes would return 1,2

Specified by:
getCommonPrefixes in interface ListBucketResponse
See Also:
ListBucketOptions.getPrefix()

getDelimiter

public String getDelimiter()
Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response.

Specified by:
getDelimiter in interface ListBucketResponse

getMarker

public String getMarker()

Specified by:
getMarker in interface ListBucketResponse

getNextMarker

public String getNextMarker()
Indicates where in the bucket to begin listing. The list will only include keys that occur lexicographically after marker. This is convenient for pagination: To get the next page of results use the last key of the current page as the marker.

Specified by:
getNextMarker in interface ListBucketResponse

getMaxKeys

public int getMaxKeys()
The maximum number of keys you'd like to see in the response body. The server might return fewer than this many keys, but will not return more.

Specified by:
getMaxKeys in interface ListBucketResponse

getPrefix

public String getPrefix()
Limits the response to keys which begin with the indicated prefix. You can use prefixes to separate a bucket into different sets of keys in a way similar to how a file system uses folders.

Specified by:
getPrefix in interface ListBucketResponse

isTruncated

public boolean isTruncated()
There are more then maxKeys available

Specified by:
isTruncated in interface ListBucketResponse

getName

public String getName()
name of the Bucket

Specified by:
getName in interface ListBucketResponse

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<ObjectMetadata>
Specified by:
hashCode in interface Set<ObjectMetadata>
Overrides:
hashCode in class AbstractSet<ObjectMetadata>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Collection<ObjectMetadata>
Specified by:
equals in interface Set<ObjectMetadata>
Overrides:
equals in class AbstractSet<ObjectMetadata>


Copyright © 2009-2011 jclouds. All Rights Reserved.