@SuppressWarnings("unchecked") public static MultipartUploadListing parseListMultipartUploads(InputStream responseBody) throws ResponseParseException {
  try {
    Element root=getXmlRootElement(responseBody);
    MultipartUploadListing multipartUploadListing=new MultipartUploadListing();
    multipartUploadListing.setBucketName(root.getChildText("Bucket"));
    multipartUploadListing.setMaxUploads(Integer.valueOf(root.getChildText("MaxUploads")));
    multipartUploadListing.setTruncated(Boolean.valueOf(root.getChildText("IsTruncated")));
    if (root.getChild("Delimiter") != null) {
      String delimiter=root.getChildText("Delimiter");
      if (!isNullOrEmpty(delimiter)) {
        multipartUploadListing.setDelimiter(delimiter);
      }
    }
    if (root.getChild("Prefix") != null) {
      String prefix=root.getChildText("Prefix");
      if (!isNullOrEmpty(prefix)) {
        multipartUploadListing.setPrefix(prefix);
      }
    }
    if (root.getChild("KeyMarker") != null) {
      String keyMarker=root.getChildText("KeyMarker");
      if (!isNullOrEmpty(keyMarker)) {
        multipartUploadListing.setKeyMarker(keyMarker);
      }
    }
    if (root.getChild("UploadIdMarker") != null) {
      String uploadIdMarker=root.getChildText("UploadIdMarker");
      if (!isNullOrEmpty(uploadIdMarker)) {
        multipartUploadListing.setUploadIdMarker(uploadIdMarker);
      }
    }
    if (root.getChild("NextKeyMarker") != null) {
      String nextKeyMarker=root.getChildText("NextKeyMarker");
      if (!isNullOrEmpty(nextKeyMarker)) {
        multipartUploadListing.setNextKeyMarker(nextKeyMarker);
      }
    }
    if (root.getChild("NextUploadIdMarker") != null) {
      String nextUploadIdMarker=root.getChildText("NextUploadIdMarker");
      if (!isNullOrEmpty(nextUploadIdMarker)) {
        multipartUploadListing.setNextUploadIdMarker(nextUploadIdMarker);
      }
    }
    List<Element> uploadElems=root.getChildren("Upload");
    for (    Element elem : uploadElems) {
      if (elem.getChild("Initiated") == null) {
        continue;
      }
      MultipartUpload mu=new MultipartUpload();
      mu.setKey(elem.getChildText("Key"));
      mu.setUploadId(elem.getChildText("UploadId"));
      mu.setStorageClass(elem.getChildText("StorageClass"));
      mu.setInitiated(DateUtil.parseIso8601Date(elem.getChildText("Initiated")));
      multipartUploadListing.addMultipartUpload(mu);
    }
    List<Element> commonPrefixesElems=root.getChildren("CommonPrefixes");
    for (    Element elem : commonPrefixesElems) {
      String prefix=elem.getChildText("Prefix");
      if (!isNullOrEmpty(prefix)) {
        multipartUploadListing.addCommonPrefix(prefix);
      }
    }
    return multipartUploadListing;
  }
 catch (  Exception e) {
    throw new ResponseParseException(e.getMessage(),e);
  }
}

@ SuppressWarnings ( "unchecked" ) public static MultipartUploadListing parseListMultipartUploads ( InputStream responseBody ) throws ResponseParseException { try { Element root = getXmlRootElement ( responseBody ) ; MultipartUploadListing multipartUploadListing = new MultipartUploadListing ( ) ; multipartUploadListing . setBucketName ( root . getChildText ( "Bucket" ) ) ; multipartUploadListing . setMaxUploads ( Integer . valueOf ( root . getChildText ( "MaxUploads" ) ) ) ; multipartUploadListing . setTruncated ( Boolean . valueOf ( root . getChildText ( "IsTruncated" ) ) ) ; if ( root . getChild ( "Delimiter" ) != null ) { String delimiter = root . getChildText ( "Delimiter" ) ; if ( ! isNullOrEmpty ( delimiter ) ) { multipartUploadListing . setDelimiter ( delimiter ) ; } } if ( root . getChild ( "Prefix" ) != null ) { String prefix = root . getChildText ( "Prefix" ) ; if ( ! isNullOrEmpty ( prefix ) ) { multipartUploadListing . setPrefix ( prefix ) ; } } if ( root . getChild ( "KeyMarker" ) != null ) { String keyMarker = root . getChildText ( "KeyMarker" ) ; if ( ! isNullOrEmpty ( keyMarker ) ) { multipartUploadListing . setKeyMarker ( keyMarker ) ; } } if ( root . getChild ( "UploadIdMarker" ) != null ) { String uploadIdMarker = root . getChildText ( "UploadIdMarker" ) ; if ( ! isNullOrEmpty ( uploadIdMarker ) ) { multipartUploadListing . setUploadIdMarker ( uploadIdMarker ) ; } } if ( root . getChild ( "NextKeyMarker" ) != null ) { String nextKeyMarker = root . getChildText ( "NextKeyMarker" ) ; if ( ! isNullOrEmpty ( nextKeyMarker ) ) { multipartUploadListing . setNextKeyMarker ( nextKeyMarker ) ; } } if ( root . getChild ( "NextUploadIdMarker" ) != null ) { String nextUploadIdMarker = root . getChildText ( "NextUploadIdMarker" ) ; if ( ! isNullOrEmpty ( nextUploadIdMarker ) ) { multipartUploadListing . setNextUploadIdMarker ( nextUploadIdMarker ) ; } } List < Element > uploadElems = root . getChildren ( "Upload" ) ; for ( Element elem : uploadElems ) { if ( elem . getChild ( "Initiated" ) == null ) { continue ; } MultipartUpload mu = new MultipartUpload ( ) ; mu . setKey ( elem . getChildText ( "Key" ) ) ; mu . setUploadId ( elem . getChildText ( "UploadId" ) ) ; mu . setStorageClass ( elem . getChildText ( "StorageClass" ) ) ; mu . setInitiated ( DateUtil . parseIso8601Date ( elem . getChildText ( "Initiated" ) ) ) ; multipartUploadListing . addMultipartUpload ( mu ) ; } List < Element > commonPrefixesElems = root . getChildren ( "CommonPrefixes" ) ; for ( Element elem : commonPrefixesElems ) { String prefix = elem . getChildText ( "Prefix" ) ; if ( ! isNullOrEmpty ( prefix ) ) { multipartUploadListing . addCommonPrefix ( prefix ) ; } } return multipartUploadListing ; } catch ( Exception e ) { throw new ResponseParseException ( e . getMessage ( ) , e ) ; } }
unmarshall list multipart uploads response body to multipart upload listing .
