hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneRestClient.java
public List<OzoneKey> listKeys(String volumeName, String bucketName,
      String resultLength, String previousKey, String prefix)
      throws OzoneException {
    OzoneUtils.verifyResourceName(volumeName);
    OzoneUtils.verifyResourceName(bucketName);

    HttpGet getRequest = null;
    try (CloseableHttpClient httpClient = HddsClientUtils.newHttpClient()) {
      URIBuilder builder = new URIBuilder(getEndPointURI());
      builder.setPath("/" + volumeName + "/" + bucketName).build();

      if (!Strings.isNullOrEmpty(resultLength)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_MAXKEYS, resultLength);
      }

      if (!Strings.isNullOrEmpty(previousKey)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREVKEY, previousKey);
      }

      if (!Strings.isNullOrEmpty(prefix)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix);
      }

      getRequest = getHttpGet(builder.toString());
      return OzoneBucket.executeListKeys(getRequest, httpClient);
    } catch (IOException | URISyntaxException e) {
      throw new OzoneRestClientException(e.getMessage(), e);
    } finally {
      releaseConnection(getRequest);
    }
  }
/**
   * List all keys in the given bucket.
   *
   * @param volumeName - Volume name
   * @param bucketName - Bucket name
   * @param resultLength The max length of listing result.
   * @param previousKey The key from where listing should start,
   *                    this key is excluded in the result.
   * @param prefix The prefix that return list keys start with.
   *
   * @return List of OzoneKeys
   */
List all keys in the given bucket.
@param volumeName - Volume name
@param bucketName - Bucket name
@param resultLength The max length of listing result.
@param previousKey The key from where listing should start,
this key is excluded in the result.
@param prefix The prefix that return list keys start with.

@return List of OzoneKeys
List all keys in the given bucket . @param volumeName - Volume name @param bucketName - Bucket name @param resultLength The max length of listing result . @param previousKey The key from where listing should start this key is excluded in the result . @param prefix The prefix that return list keys start with . @return List of OzoneKeys
public List<OzoneKey> listKeys(String volumeName, String bucketName,
      String resultLength, String previousKey, String prefix)
      throws OzoneException {
    OzoneUtils.verifyResourceName(volumeName);
    OzoneUtils.verifyResourceName(bucketName);
    HttpGet getRequest = null;
    try (CloseableHttpClient httpClient = HddsClientUtils.newHttpClient()) {
      URIBuilder builder = new URIBuilder(getEndPointURI());
      builder.setPath("/" + volumeName + "/" + bucketName).build();
      if (!Strings.isNullOrEmpty(resultLength)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_MAXKEYS, resultLength);
      }
      if (!Strings.isNullOrEmpty(previousKey)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREVKEY, previousKey);
      }
      if (!Strings.isNullOrEmpty(prefix)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix);
      }
      getRequest = getHttpGet(builder.toString());
      return OzoneBucket.executeListKeys(getRequest, httpClient);
    } catch (IOException | URISyntaxException e) {
      throw new OzoneRestClientException(e.getMessage(), e);
    } finally {
      releaseConnection(getRequest);
    }
  }
public List < OzoneKey > listKeys ( String volumeName , String bucketName , String resultLength , String previousKey , String prefix ) throws OzoneException { OzoneUtils . verifyResourceName ( volumeName ) ; OzoneUtils . verifyResourceName ( bucketName ) ; HttpGet getRequest = null ; try ( CloseableHttpClient httpClient = HddsClientUtils . newHttpClient ( ) ) { URIBuilder builder = new URIBuilder ( getEndPointURI ( ) ) ; builder . setPath ( "/" + volumeName + "/" + bucketName ) . build ( ) ; if ( ! Strings . isNullOrEmpty ( resultLength ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_MAXKEYS , resultLength ) ; } if ( ! Strings . isNullOrEmpty ( previousKey ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREVKEY , previousKey ) ; } if ( ! Strings . isNullOrEmpty ( prefix ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREFIX , prefix ) ; } getRequest = getHttpGet ( builder . toString ( ) ) ; return OzoneBucket . executeListKeys ( getRequest , httpClient ) ; } catch ( IOException | URISyntaxException e ) { throw new OzoneRestClientException ( e . getMessage ( ) , e ) ; } finally { releaseConnection ( getRequest ) ; } }
List all keys in the given bucket.
List all keys in the given bucket .