private ListBucketResult listObjectsV2(String bucketName, String continuationToken, String prefix, String delimiter)
    throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
           InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
           InternalException {
    Map<String,String> queryParamMap = new HashMap<>();
    queryParamMap.put("list-type", "2");

    if (continuationToken != null) {
      queryParamMap.put("continuation-token", continuationToken);
    }

    if (prefix != null) {
      queryParamMap.put("prefix", prefix);
    } else {
      queryParamMap.put("prefix", "");
    }

    if (delimiter != null) {
      queryParamMap.put("delimiter", delimiter);
    } else {
      queryParamMap.put("delimiter", "");
    }

    HttpResponse response = executeGet(bucketName, null, null, queryParamMap);

    ListBucketResult result = new ListBucketResult();
    result.parseXml(response.body().charStream());
    response.body().close();
    return result;
  }
private ListBucketResult listObjectsV2 ( String bucketName , String continuationToken , String prefix , String delimiter ) throws InvalidBucketNameException , NoSuchAlgorithmException , InsufficientDataException , IOException , InvalidKeyException , NoResponseException , XmlPullParserException , ErrorResponseException , InternalException { Map < String , String > queryParamMap = new HashMap < > ( ) ; queryParamMap . put ( "list-type" , "2" ) ; if ( continuationToken != null ) { queryParamMap . put ( "continuation-token" , continuationToken ) ; } if ( prefix != null ) { queryParamMap . put ( "prefix" , prefix ) ; } else { queryParamMap . put ( "prefix" , "" ) ; } if ( delimiter != null ) { queryParamMap . put ( "delimiter" , delimiter ) ; } else { queryParamMap . put ( "delimiter" , "" ) ; } HttpResponse response = executeGet ( bucketName , null , null , queryParamMap ) ; ListBucketResult result = new ListBucketResult ( ) ; result . parseXml ( response . body ( ) . charStream ( ) ) ; response . body ( ) . close ( ) ; return result ; }
Returns {@link ListBucketResult} of given bucket, marker, prefix and delimiter.

@param bucketName        Bucket name.
@param continuationToken Marker string.  List objects whose name is greater than `marker`.
@param prefix            Prefix string.  List objects whose name starts with `prefix`.
@param delimiter         Delimiter string.  Group objects whose name contains `delimiter`.