You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using following code to download an object from S3 into a file.
(When doing exactly the same request with the non async client I do not run into any issues):
val tmp =System.getProperty("java.io.tmpdir")
val filePath =Path.of("$tmp/${UUID.randomUUID()}.tmp")
val config =FileTransformerConfiguration
.builder()
.fileWriteOption(FileTransformerConfiguration.FileWriteOption.CREATE_NEW)
.build()
s3Client.getObject(
buildGetObjectRequest(bucket, key),
AsyncResponseTransformer.toFile(filePath, config),
)
privatefunbuildGetObjectRequest(
bucket:String,
key:String,
): GetObjectRequest=GetObjectRequest
.builder()
.bucket(bucket)
.key(key)
.build()
My question is am I doing something wrong here? Given the FileWriteOption.CREATE_NEW I would expect that the file is created when I pass a Path to the AsyncResponseTransformer.
Side note: I am experimenting with File vs. Path and the FileWriteOptions because when running multiple getObject().join() asynchronously using Coroutines I run into java.nio.file.FileAlreadyExistsException: /tmp/cdbc1300-c412-4d34-bdb8-5cf19e8471ea.tmp despite using UUIDs.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am using following code to download an object from S3 into a file.
(When doing exactly the same request with the non async client I do not run into any issues):
Once executed I run into:
My question is am I doing something wrong here? Given the
FileWriteOption.CREATE_NEW
I would expect that the file is created when I pass a Path to theAsyncResponseTransformer
.Side note: I am experimenting with File vs. Path and the FileWriteOptions because when running multiple
getObject().join()
asynchronously using Coroutines I run intojava.nio.file.FileAlreadyExistsException: /tmp/cdbc1300-c412-4d34-bdb8-5cf19e8471ea.tmp
despite using UUIDs.Beta Was this translation helpful? Give feedback.
All reactions