From f0809bb51642a2f61e16d3b89fb1558525c585b0 Mon Sep 17 00:00:00 2001 From: Afly Date: Wed, 21 Feb 2024 17:32:17 +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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 a86855d..6a25448 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,7 +412,12 @@ public class S3ResourceRepository extends BaseResourceRepository { @Override public boolean isDirectory(String path) { - return dirExist(path); + if (!path.endsWith(DELIMITER) && fileExist(path)) { + //是文件 + return false; + } else { + return dirExist(path) || isParentPathAbsent(path); + } } @Override