|
|
|
@ -412,17 +412,7 @@ public class S3ResourceRepository extends BaseResourceRepository {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean isDirectory(String path) { |
|
|
|
|
if (path.endsWith(DELIMITER)) { |
|
|
|
|
return exist(path); |
|
|
|
|
} else { |
|
|
|
|
ObjectListing listing = s3.listObjects(bucket, path); |
|
|
|
|
List<S3ObjectSummary> objectSummaries = listing.getObjectSummaries(); |
|
|
|
|
if (objectSummaries.isEmpty()) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
String dirFormat = path + DELIMITER; |
|
|
|
|
return objectSummaries.stream().anyMatch(s3ObjectSummary -> StringUtils.equals(s3ObjectSummary.getKey(), dirFormat)); |
|
|
|
|
} |
|
|
|
|
return dirExist(path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|