From 2e08c74f75a33e276f358c8ac4c67d4cc9ff5324 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Thu, 23 Feb 2023 18:11:49 +0100 Subject: [PATCH] Update log for Download failure in case of override --- .../e/drive/operations/DownloadFileOperation.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/foundation/e/drive/operations/DownloadFileOperation.java b/app/src/main/java/foundation/e/drive/operations/DownloadFileOperation.java index 654fde1d..5a3e9aa6 100644 --- a/app/src/main/java/foundation/e/drive/operations/DownloadFileOperation.java +++ b/app/src/main/java/foundation/e/drive/operations/DownloadFileOperation.java @@ -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; } -- GitLab