TransferManager downloadDirectory woes #3717
Replies: 2 comments 1 reply
-
The exceptions are associated with the objects that were created as "folders". S3 does not have the concept of folders, everything is an object, and a "folder" is just an object of size 0 and a separator, like That said, if those "folders" listed in the exceptions contain any objects, they should be downloaded successfully by Let us know if this helps. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, @debora-ito :) Indeed, I'm aware of how S3 handles "folders" - thanks for the context. Interestingly, the exception is actually pointing to the folder on my local filesystem where I want the prefix on s3 to be downloaded to. In other words, the exceptions do NOT mention any objects / virtual folders in S3:
In any case, all "folders" matching the specified prefix do in fact contain objects, so everything should download as I understand it.. yet nothing does. I originally started with a more complex case of nested folders, but have made things even simpler. I want to download this: s3://bucket/prefix/object_a by specifying This fails in the same way, with a FileSystemException complaining that my destination folder |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm trying to use the v2 Java SDK's TransferManager to download a prefix recursively. In other words, I want to mirror the behavior of the --recursive flag on the AWS CLI. I'm following the SDK example here:
https://github.com/aws/aws-sdk-java-v2/blob/master/services-custom/s3-transfer-manager/README.md#download-s3-objects-within-the-same-bucket-to-a-local-directory
When I try to do this I get an exception like this.
Exception in thread "Thread-14" Exception java.io.UncheckedIOException: java.nio.file.FileSystemException: /var/tmp/getdir2 Is a directory
Here's the implementation.
The prefix in this example is structured like this:
s3://bucket/prefix/
s3://bucket/prefix/data/
s3://bucket/prefix/artifacts/
and I want to do the equivalent of
aws s3 cp s3://bucket/prefix/ /var/tmp/getdir2/ --recursive
which would download everything in bucket/prefix/ - files and virtual folders included.
What am I missing>?
Beta Was this translation helpful? Give feedback.
All reactions