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