Skip to content

[BUG] S3DBService fails to handle existing files during download #5898

@KirtanKakadiya

Description

@KirtanKakadiya

Describe the bug
When downloading the databases from S3, the download will fail if the current file exists as it is not able to overwrite the file. The method which causes this issue is S3DBService.buildRequestAndDownloadFile. Currently this method uses Files.copy from the java.nio.file.Files package which does not allow overwrites.

The solution would be to use the ResponseTransformer.toFile(path) method like this:
S3Client.getObject((b) -> { b.bucket(bucketName).key(key);}, ResponseTransformer.toFile(destination));

Expected behavior
The S3DBService is able to overwrite the file if the file already exists

Environment (please complete the following information):

  • OS: Linux
  • Version 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Unplanned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions