MathieuLoutre / mock-aws-s3

Library to mock the AWS SDK for Node.js
MIT License
113 stars 77 forks source link

listObjects delimiter #65

Open mathieuedet opened 4 years ago

mathieuedet commented 4 years ago

Hi,

I discovered this library and it's really nice but I encountering a problem with listObjects and listObjectsV2 methods.

I don't have same responses that aws sdk. I just want to list all directory and files at a specific path. So I specify delimiter : "/" and Prefix with my path.

The problem is that response contains all subdirectories and files including in these directories.

Official AWS SDK returns only directories and files to specific prefix

|--- rootfolder/ __| file.txt __|--- Folder1/ __|--- Subfolder1 __|---File1.txt ___|---File12.txt __| Folder2/ __| File2.txt

Options :

Results should contains array of CommonPrefixes with "Prefix" (Folder1, Folder2) and Key "file.txt". But it returns "Subfolder1", "File1", "File12", "File2" too.

sr258 commented 4 years ago

There seems to be another issue with the delimiter, too: The NextContinuationToken is not returned, if it is not set. Howver, I want the token, but not set the Delimiter.