From 32d148cbb274571a3f9ca509d02256e1d01139ef Mon Sep 17 00:00:00 2001 From: Afly Date: Wed, 21 Feb 2024 15:30:19 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-112857=20fix:=20=E6=94=B9=E4=B8=8BisDir?= =?UTF-8?q?=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fs/s3/repository/core/S3ResourceRepository.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java b/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java index 7b6f2cf..a86855d 100644 --- a/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java +++ b/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java @@ -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 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