From 28499190459d71bb7c879e6b05b459736c340b43 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 e1ffd389..be875611 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 @@ -42,7 +42,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 5a3f0e7d..f6412f3f 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 @@ -57,7 +57,7 @@ class OCFileService(override val client: OwnCloudClient) : FileService { override fun downloadFile( remotePath: String, localTempPath: String - ): RemoteOperationResult = + ): RemoteOperationResult = DownloadRemoteFileOperation( remotePath = remotePath, localFolderPath = localTempPath