From 3a996ef58324e5e89d34f81516ecb7db2f70c75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 17 Nov 2020 16:15:40 +0100 Subject: [PATCH] Download file operation will return unit instead of Any --- .../lib/resources/files/DownloadRemoteFileOperation.kt | 10 +++++----- .../lib/resources/files/services/FileService.kt | 2 +- .../files/services/implementation/OCFileService.kt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt index fddeb692..793cca5b 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt @@ -48,7 +48,7 @@ import java.util.concurrent.atomic.AtomicBoolean class DownloadRemoteFileOperation( private val remotePath: String, localFolderPath: String -) : RemoteOperation() { +) : RemoteOperation() { private val mCancellationRequested = AtomicBoolean(false) private val mDataTransferListeners: MutableSet = HashSet() @@ -58,8 +58,8 @@ class DownloadRemoteFileOperation( var etag: String = "" private set - override fun run(client: OwnCloudClient): RemoteOperationResult { - var result: RemoteOperationResult + override fun run(client: OwnCloudClient): RemoteOperationResult { + var result: RemoteOperationResult // download will be performed to a temporal file, then moved to the final location val tmpFile = File(tmpPath) @@ -77,8 +77,8 @@ class DownloadRemoteFileOperation( } @Throws(Exception::class) - private fun downloadFile(client: OwnCloudClient, targetFile: File): RemoteOperationResult { - val result: RemoteOperationResult + private fun downloadFile(client: OwnCloudClient, targetFile: File): RemoteOperationResult { + val result: RemoteOperationResult var it: Iterator var fos: FileOutputStream? = null var bis: BufferedInputStream? = null diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/FileService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/FileService.kt index ec0b7421..0a43d0f8 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/FileService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/FileService.kt @@ -44,7 +44,7 @@ interface FileService : Service { fun downloadFile( remotePath: String, localTempPath: String - ): RemoteOperationResult + ): RemoteOperationResult fun refreshFolder( remotePath: String diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt index d49533bb..55892f4a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt @@ -61,7 +61,7 @@ class OCFileService(override val client: OwnCloudClient) : FileService { override fun downloadFile( remotePath: String, localTempPath: String - ): RemoteOperationResult = + ): RemoteOperationResult = DownloadRemoteFileOperation( remotePath = remotePath, localFolderPath = localTempPath