diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt index b576f7e10f9..ab4a0475000 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt @@ -30,7 +30,7 @@ import androidx.work.WorkManager import androidx.work.workDataOf import com.owncloud.android.domain.BaseUseCase import com.owncloud.android.domain.camerauploads.model.UploadBehavior -import com.owncloud.android.workers.RemoveLocalFileWorker +import com.owncloud.android.workers.RemoveSourceFileWorker import com.owncloud.android.workers.UploadFileFromContentUriWorker import timber.log.Timber @@ -47,7 +47,7 @@ class UploadFileFromContentUriUseCase( UploadFileFromContentUriWorker.KEY_PARAM_UPLOAD_PATH to params.uploadPath, UploadFileFromContentUriWorker.KEY_PARAM_UPLOAD_ID to params.uploadIdInStorageManager ) - val inputDataRemoveLocalFileWorker = workDataOf( + val inputDataRemoveSourceFileWorker = workDataOf( UploadFileFromContentUriWorker.KEY_PARAM_CONTENT_URI to params.contentUri.toString(), ) @@ -66,11 +66,11 @@ class UploadFileFromContentUriUseCase( val behavior = UploadBehavior.fromString(params.behavior) if (behavior == UploadBehavior.MOVE) { - val removeLocalFileWorker = OneTimeWorkRequestBuilder() - .setInputData(inputDataRemoveLocalFileWorker) + val removeSourceFileWorker = OneTimeWorkRequestBuilder() + .setInputData(inputDataRemoveSourceFileWorker) .build() workManager.beginWith(uploadFileFromContentUriWorker) - .then(removeLocalFileWorker) // File is already uploaded, so the original one can be removed if the behaviour is MOVE + .then(removeSourceFileWorker) // File is already uploaded, so the original one can be removed if the behaviour is MOVE .enqueue() } else { workManager.enqueue(uploadFileFromContentUriWorker) diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt index 7bb3e00950b..6a219462de0 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt @@ -28,7 +28,7 @@ import androidx.work.WorkManager import androidx.work.workDataOf import com.owncloud.android.domain.BaseUseCase import com.owncloud.android.domain.camerauploads.model.UploadBehavior -import com.owncloud.android.workers.RemoveLocalFileWorker +import com.owncloud.android.workers.RemoveSourceFileWorker import com.owncloud.android.workers.UploadFileFromContentUriWorker import com.owncloud.android.workers.UploadFileFromFileSystemWorker import timber.log.Timber @@ -46,7 +46,7 @@ class UploadFileFromSystemUseCase( UploadFileFromFileSystemWorker.KEY_PARAM_UPLOAD_PATH to params.uploadPath, UploadFileFromFileSystemWorker.KEY_PARAM_UPLOAD_ID to params.uploadIdInStorageManager ) - val inputDataRemoveLocalFileWorker = workDataOf( + val inputDataRemoveSourceFileWorker = workDataOf( UploadFileFromContentUriWorker.KEY_PARAM_CONTENT_URI to params.sourcePath, ) @@ -63,11 +63,11 @@ class UploadFileFromSystemUseCase( val behavior = UploadBehavior.fromString(params.behavior) if (behavior == UploadBehavior.MOVE) { - val removeLocalFileWorker = OneTimeWorkRequestBuilder() - .setInputData(inputDataRemoveLocalFileWorker) + val removeSourceFileWorker = OneTimeWorkRequestBuilder() + .setInputData(inputDataRemoveSourceFileWorker) .build() workManager.beginWith(uploadFileFromSystemWorker) - .then(removeLocalFileWorker) // File is already uploaded, so the original one can be removed if the behaviour is MOVE + .then(removeSourceFileWorker) // File is already uploaded, so the original one can be removed if the behaviour is MOVE .enqueue() } else { workManager.enqueue(uploadFileFromSystemWorker) diff --git a/owncloudApp/src/main/java/com/owncloud/android/workers/RemoveLocalFileWorker.kt b/owncloudApp/src/main/java/com/owncloud/android/workers/RemoveSourceFileWorker.kt similarity index 98% rename from owncloudApp/src/main/java/com/owncloud/android/workers/RemoveLocalFileWorker.kt rename to owncloudApp/src/main/java/com/owncloud/android/workers/RemoveSourceFileWorker.kt index d365c144710..c16b5b0f54e 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/workers/RemoveLocalFileWorker.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/workers/RemoveSourceFileWorker.kt @@ -30,7 +30,7 @@ import com.owncloud.android.workers.UploadFileFromContentUriWorker.Companion.KEY import org.koin.core.component.KoinComponent import timber.log.Timber -class RemoveLocalFileWorker( +class RemoveSourceFileWorker( private val appContext: Context, private val workerParameters: WorkerParameters ) : CoroutineWorker(