Methods prefixExists() and isFolderEmpty() both use getListObjects()
with the "MaxKeys: 1" argument.
If the directory contains more than one file, the API says the result is
truncated (which we wanted!), which causes getListObjects() to load all
objects in the folder.
This patch checks if the MaxKeys argument was provided, and prevents
loading the truncated objects in that case.
On S3 this happens when using a bucket that has no special "folder objects"
(which are created by aus_driver_amazon_s3).
With MinIO it always happens, because HEAD requests fail for non-empty folders,
and thus listObjects is always used.
Methods prefixExists() and isFolderEmpty() both use getListObjects() with the "MaxKeys: 1" argument. If the directory contains more than one file, the API says the result is truncated (which we wanted!), which causes getListObjects() to load all objects in the folder.
This patch checks if the MaxKeys argument was provided, and prevents loading the truncated objects in that case.
On S3 this happens when using a bucket that has no special "folder objects" (which are created by aus_driver_amazon_s3).
With MinIO it always happens, because HEAD requests fail for non-empty folders, and thus listObjects is always used.