Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

Change way to move file at the end of a download

Vincent Bourgmayer requested to merge 831-replace-file-moving-code into v1-oreo

Description

Change the way to move downloaded temporary file to final location at the end of a download. The previous way to do it, was using File.renameTo() which required old version of a file to be deleted because renameTo() cannot override. This deletion was catched by FileEventListener, which triggers Remote File deletion in this case, so it might result in cloud file deletion, etc.

Technical details

The temporary file is downloaded into cacheDir (so RAM and not disc)

Tests

Issues

https://gitlab.e.foundation/e/os/backlog/-/issues/831

10 commandments of code reviews

👪 https://gitlab.e.foundation/internal/wiki/-/wikis/development/code-review

Edited by Vincent Bourgmayer

Merge request reports

Loading