1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Download file operation will return unit instead of Any

This commit is contained in:
Abel García de Prada 2020-11-17 16:15:40 +01:00 committed by Juan Carlos Garrote
parent be20267fea
commit 512fed3a88
3 changed files with 7 additions and 7 deletions

View File

@ -48,7 +48,7 @@ import java.util.concurrent.atomic.AtomicBoolean
class DownloadRemoteFileOperation(
private val remotePath: String,
localFolderPath: String
) : RemoteOperation<Any>() {
) : RemoteOperation<Unit>() {
private val mCancellationRequested = AtomicBoolean(false)
private val mDataTransferListeners: MutableSet<OnDatatransferProgressListener> = HashSet()
@ -58,8 +58,8 @@ class DownloadRemoteFileOperation(
var etag: String = ""
private set
override fun run(client: OwnCloudClient): RemoteOperationResult<Any> {
var result: RemoteOperationResult<Any>
override fun run(client: OwnCloudClient): RemoteOperationResult<Unit> {
var result: RemoteOperationResult<Unit>
// 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<Any> {
val result: RemoteOperationResult<Any>
private fun downloadFile(client: OwnCloudClient, targetFile: File): RemoteOperationResult<Unit> {
val result: RemoteOperationResult<Unit>
var it: Iterator<OnDatatransferProgressListener>
var fos: FileOutputStream? = null
var bis: BufferedInputStream? = null

View File

@ -44,7 +44,7 @@ interface FileService : Service {
fun downloadFile(
remotePath: String,
localTempPath: String
): RemoteOperationResult<Any>
): RemoteOperationResult<Unit>
fun refreshFolder(
remotePath: String

View File

@ -61,7 +61,7 @@ class OCFileService(override val client: OwnCloudClient) : FileService {
override fun downloadFile(
remotePath: String,
localTempPath: String
): RemoteOperationResult<Any> =
): RemoteOperationResult<Unit> =
DownloadRemoteFileOperation(
remotePath = remotePath,
localFolderPath = localTempPath