} else {
requestParameters.remove("upload-id-marker");
}
HttpResponse httpResponse = performRestGet(bucketName, null, requestParameters, null);
ListMultipartUploadsResultHandler handler;
try {
handler = getXmlResponseSaxParser().parseListMultipartUploadsResult(
new HttpMethodReleaseInputStream(httpResponse));
ioErrorRetryCount = 0;
} catch (ServiceException e) {
if (e.getCause() instanceof IOException
&& ioErrorRetryCount < ioErrorRetryMaxCount)
{
ioErrorRetryCount++;
if (log.isWarnEnabled()) {
log.warn("Retrying bucket listing failure due to IO error", e);
}
continue;
} else {
throw e;
}
}
List<MultipartUpload> partial = handler.getMultipartUploadList();
if (log.isDebugEnabled()) {
log.debug("Found " + partial.size() + " objects in one batch");
}
uploads.addAll(partial);
String[] partialCommonPrefixes = handler.getCommonPrefixes();
if (log.isDebugEnabled()) {
log.debug("Found " + partialCommonPrefixes.length + " common prefixes in one batch");
}
commonPrefixes.addAll(Arrays.asList(partialCommonPrefixes));
incompleteListing = handler.isTruncated();
if (incompleteListing){
nextKeyMarker = handler.getNextKeyMarker();
nextUploadIdMarker = handler.getNextUploadIdMarker();
// Sanity check for valid pagination values.
if (nextKeyMarker == null && nextUploadIdMarker == null) {
throw new ServiceException("Unable to retrieve paginated "
+ "ListMultipartUploadsResult without valid NextKeyMarker "
+ " or NextUploadIdMarker value.");