When using the AWS SDK for Java library (used by cognitect-labs/aws-api), I am experiencing an issue with DeleteObject
(AWS Documentation).
If I delete the last object in a directory, I expect to be left with an empty directory. However, DeleteObject
deletes the directory as well.
(require '[cognitect.aws.client.api :as aws])
;; Copying works fine
(aws/invoke aws/client
{:op :CopyObject
:request {:Bucket "bucket"
:CopySource "bucket/dirA/f1"
:Key "dirB/f1"}})
;; However, deleting removes f1 and dirA (if dirA is empty)
(aws/invoke aws/client
{:op :DeleteObject
:request {:Bucket "bucket"
:Key "dirA/f1"}})
Is there a way to avoid this behavior?