From 0e76c422b66e0c7fbc6cc59c1a3f91fed4b5e2e2 Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Fri, 8 Oct 2021 11:38:00 +0800 Subject: [PATCH] =?UTF-8?q?DEC-20707=20fix:=20s3=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=88=A4=E6=96=AD=E5=90=8D=E7=A7=B0=20+=20"/?= =?UTF-8?q?"=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=EF=BC=8C=E6=9D=A5?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../s3/repository/core/S3ResourceRepository.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 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 e411788..c2bbc6e 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 @@ -249,20 +249,7 @@ public class S3ResourceRepository extends BaseResourceRepository { @Override public boolean isDirectory(String path) { - - if (path.endsWith(DELIMITER) && exist(path)) { - return true; - } - ObjectListing listing = s3.listObjects(bucket, path); - if (listing.getObjectSummaries().isEmpty()) { - return false; - } - if (listing.getObjectSummaries().size() > 1) { - return true; - } else { - S3ObjectSummary summary = listing.getObjectSummaries().get(0); - return !StringKit.equals(listing.getPrefix(), summary.getKey()); - } + return exist(path.endsWith(DELIMITER) ? path : path + DELIMITER); } @Override