File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
opencloudApp/src/main/java/eu/opencloud/android/usecases/synchronization Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,11 @@ class SynchronizeFileUseCase(
7878 val uuid = requestForDownload(accountName = accountName, ocFile = fileToSynchronize)
7979 SyncType .DownloadEnqueued (uuid)
8080 } else {
81- // 3. Check if file has changed locally
82- val changedLocally = fileToSynchronize.localModificationTimestamp > fileToSynchronize.lastSyncDateForData!!
83- Timber .i(" Local file modification timestamp :${fileToSynchronize.localModificationTimestamp} " +
81+ // 3. Check if file has changed locally by reading ACTUAL file timestamp from filesystem
82+ val localFile = File (fileToSynchronize.storagePath!! )
83+ val actualFileModificationTime = localFile.lastModified()
84+ val changedLocally = actualFileModificationTime > fileToSynchronize.lastSyncDateForData!!
85+ Timber .i(" Actual file modification timestamp :$actualFileModificationTime " +
8486 " and last sync date for data :${fileToSynchronize.lastSyncDateForData} " )
8587 Timber .i(" So it has changed locally: $changedLocally " )
8688
You can’t perform that action at this time.
0 commit comments