{
Log.info("Bucket List\n");
/* Get the list of files from S3 */
ListAllMyBucketsResult listResult = null;
/* Get a page of results */
listResult = getBucketList();
long bucketCount = 0;
/* Process this list of keys */
for (ListAllMyBucketsEntry listEntry : listResult.getBuckets())
{
String bucket = listEntry.getName();
Log.info(this.df_.format(listEntry.getCreationDate().getTime()) + " - " + bucket + "\n");
bucketCount++;
}
Log.info(String.format("total: %d\n", bucketCount));
}
else
{
/* If a bucket is specified, then list the files in the bucket */
String marker = null;
/* Get the list of files from S3 */
ListBucketResult listResult = null;
/* This do while loop deals with the paging of s3 lists */
do
{
/* Get a page of results */
listResult = getBucketObjectList(marker, getBucketName(), getPrefixName(), MAX_KEYS_PER_LIST);
if (listResult.getContents() != null)
{
/* Process this list of keys */
for (ListEntry listEntry : listResult.getContents())
{
marker = listEntry.getKey();
processListEntry(listEntry);
}
}
}
while(listResult.isIsTruncated());
/* Now that each object has been processed, dump the results to the screen */
Iterator keyIterator = this.archives_.keySet().iterator();
while (keyIterator.hasNext())