} else {
parameters.remove("marker");
}
HttpMethodBase httpMethod = performRestGet(bucketName, null, parameters, null);
ListBucketHandler listBucketHandler = null;
try {
listBucketHandler = (new XmlResponsesSaxParser())
.parseListBucketObjectsResponse(
new HttpMethodReleaseInputStream(httpMethod));
ioErrorRetryCount = 0;
} catch (S3ServiceException e) {
if (e.getCause() instanceof IOException && ioErrorRetryCount < 5) {
ioErrorRetryCount++;
if (log.isWarnEnabled()) {
log.warn("Retrying bucket listing failure due to IO error", e);
}
continue;
} else {
throw e;
}
}
S3Object[] partialObjects = listBucketHandler.getObjects();
if (log.isDebugEnabled()) {
log.debug("Found " + partialObjects.length + " objects in one batch");
}
objects.addAll(Arrays.asList(partialObjects));
String[] partialCommonPrefixes = listBucketHandler.getCommonPrefixes();
if (log.isDebugEnabled()) {
log.debug("Found " + partialCommonPrefixes.length + " common prefixes in one batch");
}
commonPrefixes.addAll(Arrays.asList(partialCommonPrefixes));
incompleteListing = listBucketHandler.isListingTruncated();
if (incompleteListing) {
priorLastKey = listBucketHandler.getMarkerForNextListing();
if (log.isDebugEnabled()) {
log.debug("Yet to receive complete listing of bucket contents, "
+ "last key for prior chunk: " + priorLastKey);
}
} else {