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:
parent
ce8ac204e1
commit
96c8e87a5f
@ -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
|
||||
|
@ -44,7 +44,7 @@ interface FileService : Service {
|
||||
fun downloadFile(
|
||||
remotePath: String,
|
||||
localTempPath: String
|
||||
): RemoteOperationResult<Any>
|
||||
): RemoteOperationResult<Unit>
|
||||
|
||||
fun refreshFolder(
|
||||
remotePath: String
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user