From 4509bb2d7a6f22e3f01a53294fd1b0cda90ee5f7 Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Wed, 4 Oct 2023 19:38:01 +0200 Subject: [PATCH] check if virtual folder --- source/java/src/org/lucee/extension/resource/s3/S3.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/java/src/org/lucee/extension/resource/s3/S3.java b/source/java/src/org/lucee/extension/resource/s3/S3.java index 8ebfd8e..86c7f82 100755 --- a/source/java/src/org/lucee/extension/resource/s3/S3.java +++ b/source/java/src/org/lucee/extension/resource/s3/S3.java @@ -2059,6 +2059,10 @@ public void addAccessControlList(String bucketName, String objectName, Object ob return; } catch (AmazonServiceException ise) { + S3Info src = get(bucketName, objectName); + if (src.isVirtual()) { + throw new S3Exception("Cannot set Access Control List to a virtual folder", se); + } throw toS3Exception(ise); } } @@ -2104,6 +2108,11 @@ public void setAccessControlList(AmazonS3Client client, String bucketName, Strin return; } catch (AmazonServiceException ise) { + S3Info src = get(bucketName, objectName); + if (src.isVirtual()) { + throw new S3Exception("Cannot set Access Control List to a virtual folder", se); + } + throw toS3Exception(ise); } }