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

Commit 6e6289e2 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Merge branch '732-update-log-for-invalid-overwrite' into 'main'

Update log for Download failure in case of override

See merge request !205
parents 569cf2b0 2e08c74f
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -122,8 +122,11 @@ public class DownloadFileOperation extends RemoteOperation {
            return FILE_NOT_FOUND;
        }

        if (tmpFile.length() != remoteFile.getLength()) {
            Timber.d("Local and remote version of %s doesn't match", remoteFile.getRemotePath());
        final long tmpFileSize = tmpFile.length();
        final long remoteFileSize = remoteFile.getLength();

        if (tmpFileSize != remoteFileSize) {
            Timber.d("Local file size (%s) and remote file size (%s) of %s doesn't match", tmpFileSize, remoteFileSize, remoteFile.getRemotePath());
            tmpFile.delete();
            return INVALID_OVERWRITE;
        }