Package org.apache.hadoop.fs.s3a
Class S3ListResult
java.lang.Object
org.apache.hadoop.fs.s3a.S3ListResult
API version-independent container for S3 List responses.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedS3ListResult(software.amazon.awssdk.services.s3.model.ListObjectsResponse v1, software.amazon.awssdk.services.s3.model.ListObjectsV2Response v2) -
Method Summary
Modifier and TypeMethodDescriptionList<software.amazon.awssdk.services.s3.model.CommonPrefix>List<software.amazon.awssdk.services.s3.model.S3Object>software.amazon.awssdk.services.s3.model.ListObjectsResponsegetV1()software.amazon.awssdk.services.s3.model.ListObjectsV2ResponsegetV2()booleanDoes this listing have prefixes or objects?booleanbooleanisV1()Is this a v1 API result or v2?voidlogAtDebug(org.slf4j.Logger log) Dump the result at debug level.booleanrepresentsEmptyDirectory(String dirKey) Does this listing represent an empty directory?static S3ListResultv1(software.amazon.awssdk.services.s3.model.ListObjectsResponse result) Restricted constructors to ensure v1 or v2, not both.static S3ListResultv2(software.amazon.awssdk.services.s3.model.ListObjectsV2Response result) Restricted constructors to ensure v1 or v2, not both.
-
Constructor Details
-
S3ListResult
protected S3ListResult(software.amazon.awssdk.services.s3.model.ListObjectsResponse v1, software.amazon.awssdk.services.s3.model.ListObjectsV2Response v2)
-
-
Method Details
-
v1
Restricted constructors to ensure v1 or v2, not both.- Parameters:
result- v1 result- Returns:
- new list result container
-
v2
public static S3ListResult v2(software.amazon.awssdk.services.s3.model.ListObjectsV2Response result) Restricted constructors to ensure v1 or v2, not both.- Parameters:
result- v2 result- Returns:
- new list result container
-
isV1
public boolean isV1()Is this a v1 API result or v2?- Returns:
- true if v1, false if v2
-
getV1
public software.amazon.awssdk.services.s3.model.ListObjectsResponse getV1() -
getV2
public software.amazon.awssdk.services.s3.model.ListObjectsV2Response getV2() -
getS3Objects
-
isTruncated
public boolean isTruncated() -
getCommonPrefixes
-
hasPrefixesOrObjects
public boolean hasPrefixesOrObjects()Does this listing have prefixes or objects?- Returns:
- true if the result is non-empty
-
representsEmptyDirectory
Does this listing represent an empty directory?- Parameters:
dirKey- directory key- Returns:
- true if the list is considered empty.
-
logAtDebug
public void logAtDebug(org.slf4j.Logger log) Dump the result at debug level.- Parameters:
log- log to use
-