Skip to content

[BUG] LocalDBService fails to handle existing files during download #5899

@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 LocalDBService.initiateDownload. Currently this method uses Files.copy from the java.nio.file.Files package which does not allow overwrites.

The solution would be to use enable the overwrite option using the StandardCopyOption.REPLACE_EXISTING like this:
Files.copy(sourceFile.toPath(), destinationFile.toPath(), StandardCopyOption.REPLACE_EXISTING);

Expected behavior
The LocalDBService 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

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions