-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transferManager does not create subfolders when you uploadDirectory ? #5747
Comments
Hi @stant , I've re-read this issue a few times, and I'm not sure I understand the expected behavior. Like you mentioned, folders in S3 do not really exist. S3 is a blob storage and any keys with a "/" delimiter will appear as if they are in a directory only in the console. When you write that "missing thirdfolder/linux/" it's because there is no folder named thirdfolder/linux/, its just a prefix you attached to one of your objects so that the S3 console could display that in a directory tree-like fashion. S3 transfer manager is just a high level interface wrapping simple API operations like From the S3 documentation:
And
Thanks, |
Yes. Right. You Can create a folder like 0-byte object so support the idea of folders. and I don't know what you mean by S3 console creates a 0-byte object. I don't think it really does. Just acts like there is one because it has a subobject? Per your question, I was hoping uploadDir() would create : Thanks, |
Hi @stant ,
Sorry, let me clarify. The AWS Console only makes it seem like there are directories when looking inside of an S3 bucket. But those are just visual, not actual directories. As discussed, S3 is fundamentally a flat object store that doesn't have a true folder hierarchy. While the S3 console creates 0-byte objects to represent folders for visualization purposes, we believe this should remain a UI-level abstraction rather than being handled by the SDK's data transfer utilities. If you need folder-like organization in your application, you have a 2 options:
The TransferManager will continue to focus on its core responsibility of efficient file transfer operations. Thanks for your understanding. Best regards, |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Thanks Ran for the info. |
Describe the bug
when I uploadDir with subfolders, it uploads all the files but does not create folder entries in S3. I know S3 is just 1 big bucket with no real folders, but should it create folder entries or does it not? can we get that option?
I am expecting them when I get list and then since I don't get them I don't display them in my file manager.
missing folder for thirdfolder/linux/ thirdfolder/mac/ thirdfolder/windows/ ...
aws web screen still shows folders, so maybe it is pulling out folder names from this same output and "displaying" folders it figures out along the way? that is more work. folders explicitly created show firstfolder/ secondfolder/ but xfer manager does not create any subfolders.
listAllObjectsAsync():796 entered listAllObjectsAsync()
listAllObjectsAsync():807 S3Object name firstfolder/
listAllObjectsAsync():807 S3Object name firstfolder/New Folder/
listAllObjectsAsync():807 S3Object name firstfolder/New Folder/whatever/
listAllObjectsAsync():807 S3Object name firstfolder/New Folder/whatever/heythere.txt
listAllObjectsAsync():807 S3Object name firstfolder/New Folder/whatever/tryit.txt
listAllObjectsAsync():807 S3Object name secondfolder/
listAllObjectsAsync():807 S3Object name secondfolder/folder2nd3/
listAllObjectsAsync():807 S3Object name secondfolder/folder2nd3/folder1234/
listAllObjectsAsync():807 S3Object name secondfolder/folder2nd3/folder1234/zip.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/
listAllObjectsAsync():807 S3Object name thirdfolder/README.txt
listAllObjectsAsync():807 S3Object name thirdfolder/diskFree.groovy
missing thirdfolder/linux/
listAllObjectsAsync():807 S3Object name thirdfolder/linux/duSelected.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/linux/git-status.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/linux/grepSelectedFiles.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/linux/pasteAsLinkFiles.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/linux/tar.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/mac/duSelected.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/mac/grepSelectedFiles.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/mac/pasteAsLinkFilesMac.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/mac/tar.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/renameFiles.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/runCommandOnSelectedFiles.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/searchAndSaveToFile.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/setLogLevels.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/watchFolders.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/watchFolders2.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/watchFolders3.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/windows/findStrGrep.groovy
listAllObjectsAsync():807 S3Object name thirdfolder/zip.groovy
Regression Issue
Expected Behavior
if I am uploading a folder with subfolders, I would like folder entries, besides I think the first one, to be created also.
missing thirdfolder/linux/
missing thirdfolder/mac/ ...
Current Behavior
no errors reported
Reproduction Steps
Possible Solution
give me a method option to create subfolders as found.
Additional Information/Context
No response
AWS Java SDK version used
software.amazon.awssdk:s3:2.29.29 xfermgr same aws-crt:0.33.5
JDK version used
java version "17.0.5" 2022-10-18 LTS Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191) Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)
Operating System and version
manjaro linux 6.12.1-4 manjaro 64-bit
The text was updated successfully, but these errors were encountered: