Browse Source

Move packages

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 year ago
parent
commit
6bd335cf3c
49 changed files with 249 additions and 198 deletions
  1. 1 0
      app/src/androidTest/java/com/nextcloud/client/files/downloader/DownloaderServiceTest.kt
  2. 5 0
      app/src/androidTest/java/com/nextcloud/client/files/downloader/RegistryTest.kt
  3. 6 0
      app/src/androidTest/java/com/nextcloud/client/files/downloader/TransferManagerConnectionTest.kt
  4. 7 1
      app/src/androidTest/java/com/nextcloud/client/files/downloader/TransferManagerTest.kt
  5. 2 2
      app/src/androidTest/java/com/owncloud/android/files/FileMenuFilterIT.kt
  6. 0 1
      app/src/androidTest/java/com/owncloud/android/ui/activity/FolderPickerActivityIT.java
  7. 2 2
      app/src/debug/java/com/nextcloud/test/TestActivity.kt
  8. 1 1
      app/src/main/AndroidManifest.xml
  9. 2 2
      app/src/main/java/com/nextcloud/client/di/AppComponent.java
  10. 1 3
      app/src/main/java/com/nextcloud/client/di/ComponentsModule.java
  11. 1 1
      app/src/main/java/com/nextcloud/client/etm/EtmViewModel.kt
  12. 4 4
      app/src/main/java/com/nextcloud/client/etm/pages/EtmFileTransferFragment.kt
  13. 1 1
      app/src/main/java/com/nextcloud/client/files/Direction.kt
  14. 7 4
      app/src/main/java/com/nextcloud/client/files/Registry.kt
  15. 7 4
      app/src/main/java/com/nextcloud/client/files/Request.kt
  16. 28 21
      app/src/main/java/com/nextcloud/client/files/downloader/DownloadTask.kt
  17. 1 1
      app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadHelper.kt
  18. 10 10
      app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadIntents.kt
  19. 6 6
      app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt
  20. 9 4
      app/src/main/java/com/nextcloud/client/files/transfer/FileTransferService.kt
  21. 15 9
      app/src/main/java/com/nextcloud/client/files/transfer/Transfer.kt
  22. 7 5
      app/src/main/java/com/nextcloud/client/files/transfer/TransferManager.kt
  23. 7 5
      app/src/main/java/com/nextcloud/client/files/transfer/TransferManagerConnection.kt
  24. 14 7
      app/src/main/java/com/nextcloud/client/files/transfer/TransferManagerImpl.kt
  25. 1 1
      app/src/main/java/com/nextcloud/client/files/transfer/TransferState.kt
  26. 1 1
      app/src/main/java/com/nextcloud/client/files/upload/PostUploadAction.kt
  27. 5 4
      app/src/main/java/com/nextcloud/client/files/upload/UploadTask.kt
  28. 5 4
      app/src/main/java/com/nextcloud/client/files/upload/UploadTrigger.kt
  29. 4 4
      app/src/main/java/com/nextcloud/client/jobs/BackgroundJobFactory.kt
  30. 9 9
      app/src/main/java/com/nextcloud/client/jobs/BackgroundJobManagerImpl.kt
  31. 4 4
      app/src/main/java/com/nextcloud/client/jobs/ContactsBackupWork.kt
  32. 2 2
      app/src/main/java/com/nextcloud/client/jobs/FilesExportWork.kt
  33. 3 3
      app/src/main/java/com/owncloud/android/files/FileMenuFilter.java
  34. 2 2
      app/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java
  35. 2 2
      app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java
  36. 1 1
      app/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java
  37. 8 8
      app/src/main/java/com/owncloud/android/services/SyncFolderHandler.java
  38. 2 2
      app/src/main/java/com/owncloud/android/ui/activity/ComponentsGetter.java
  39. 2 2
      app/src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.kt
  40. 5 5
      app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java
  41. 16 16
      app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java
  42. 4 4
      app/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java
  43. 4 4
      app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java
  44. 0 1
      app/src/main/java/com/owncloud/android/ui/fragment/FileFragment.java
  45. 5 5
      app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupListFragment.java
  46. 2 2
      app/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java
  47. 11 11
      app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java
  48. 2 2
      app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java
  49. 5 5
      app/src/main/java/third_parties/sufficientlysecure/SaveCalendar.java

+ 1 - 0
app/src/androidTest/java/com/nextcloud/client/files/downloader/DownloaderServiceTest.kt

@@ -22,6 +22,7 @@ package com.nextcloud.client.files.downloader
 import androidx.test.core.app.ApplicationProvider.getApplicationContext
 import androidx.test.rule.ServiceTestRule
 import com.nextcloud.client.account.MockUser
+import com.nextcloud.client.files.transfer.FileTransferService
 import io.mockk.MockKAnnotations
 import org.junit.Assert.assertTrue
 import org.junit.Before

+ 5 - 0
app/src/androidTest/java/com/nextcloud/client/files/downloader/RegistryTest.kt

@@ -20,6 +20,11 @@
 package com.nextcloud.client.files.downloader
 
 import com.nextcloud.client.account.User
+import com.nextcloud.client.files.DownloadRequest
+import com.nextcloud.client.files.Registry
+import com.nextcloud.client.files.Request
+import com.nextcloud.client.files.transfer.Transfer
+import com.nextcloud.client.files.transfer.TransferState
 import com.owncloud.android.datamodel.OCFile
 import io.mockk.CapturingSlot
 import io.mockk.MockKAnnotations

+ 6 - 0
app/src/androidTest/java/com/nextcloud/client/files/downloader/TransferManagerConnectionTest.kt

@@ -22,6 +22,12 @@ package com.nextcloud.client.files.downloader
 import android.content.ComponentName
 import android.content.Context
 import com.nextcloud.client.account.MockUser
+import com.nextcloud.client.files.DownloadRequest
+import com.nextcloud.client.files.transfer.FileTransferService
+import com.nextcloud.client.files.transfer.Transfer
+import com.nextcloud.client.files.transfer.TransferManager
+import com.nextcloud.client.files.transfer.TransferManagerConnection
+import com.nextcloud.client.files.transfer.TransferState
 import com.owncloud.android.datamodel.OCFile
 import io.mockk.MockKAnnotations
 import io.mockk.every

+ 7 - 1
app/src/androidTest/java/com/nextcloud/client/files/downloader/TransferManagerTest.kt

@@ -23,6 +23,12 @@ import androidx.arch.core.executor.testing.InstantTaskExecutorRule
 import com.nextcloud.client.account.User
 import com.nextcloud.client.core.ManualAsyncRunner
 import com.nextcloud.client.core.OnProgressCallback
+import com.nextcloud.client.files.DownloadRequest
+import com.nextcloud.client.files.Request
+import com.nextcloud.client.files.transfer.Transfer
+import com.nextcloud.client.files.transfer.TransferManagerImpl
+import com.nextcloud.client.files.transfer.TransferState
+import com.nextcloud.client.files.upload.UploadTask
 import com.owncloud.android.datamodel.OCFile
 import com.owncloud.android.lib.common.OwnCloudClient
 import io.mockk.MockKAnnotations
@@ -101,7 +107,7 @@ class TransferManagerTest {
 
         private fun createMockTask(): DownloadTask {
             val task = mockk<DownloadTask>()
-            every { task.download(any(), any(), any()) } answers {
+            every { task.download(any()) } answers {
                 taskProgress.forEach {
                     arg<OnProgressCallback<Int>>(1).invoke(it)
                 }

+ 2 - 2
app/src/androidTest/java/com/owncloud/android/files/FileMenuFilterIT.kt

@@ -23,7 +23,7 @@ package com.owncloud.android.files
 import androidx.test.core.app.launchActivity
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import com.nextcloud.client.account.User
-import com.nextcloud.client.files.downloader.FilesDownloadWorker
+import com.nextcloud.client.files.downloader.FileDownloadWorker
 import com.nextcloud.test.TestActivity
 import com.nextcloud.utils.EditorUtils
 import com.owncloud.android.AbstractIT
@@ -62,7 +62,7 @@ class FileMenuFilterIT : AbstractIT() {
     private lateinit var mockFileUploaderBinder: FileUploader.FileUploaderBinder
 
     @MockK
-    private lateinit var mockFileDownloaderBinder: FilesDownloadWorker.FileDownloaderBinder
+    private lateinit var mockFileDownloaderBinder: FileDownloadWorker.FileDownloaderBinder
 
     @MockK
     private lateinit var mockOperationsServiceBinder: OperationsService.OperationsServiceBinder

+ 0 - 1
app/src/androidTest/java/com/owncloud/android/ui/activity/FolderPickerActivityIT.java

@@ -22,7 +22,6 @@ package com.owncloud.android.ui.activity;
  */
 
 import android.content.Intent;
-import android.view.View;
 
 import com.owncloud.android.AbstractIT;
 import com.owncloud.android.R;

+ 2 - 2
app/src/debug/java/com/nextcloud/test/TestActivity.kt

@@ -25,7 +25,7 @@ import android.os.Bundle
 import android.view.View
 import androidx.fragment.app.Fragment
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
-import com.nextcloud.client.files.downloader.FilesDownloadWorker
+import com.nextcloud.client.files.downloader.FileDownloadWorker
 import com.nextcloud.client.network.Connectivity
 import com.nextcloud.client.network.ConnectivityService
 import com.nextcloud.utils.EditorUtils
@@ -130,7 +130,7 @@ class TestActivity :
         return null
     }
 
-    override fun getFileDownloaderBinder(): FilesDownloadWorker.FileDownloaderBinder? {
+    override fun getFileDownloaderBinder(): FileDownloadWorker.FileDownloaderBinder? {
         return null
     }
 

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -394,7 +394,7 @@
             android:name=".services.OperationsService"
             android:exported="false" />
         <service
-            android:name="com.nextcloud.client.files.downloader.FileTransferService"
+            android:name="com.nextcloud.client.files.transfer.FileTransferService"
             android:foregroundServiceType="dataSync"
             android:exported="false" />
         <service

+ 2 - 2
app/src/main/java/com/nextcloud/client/di/AppComponent.java

@@ -26,7 +26,7 @@ import com.nextcloud.appReview.InAppReviewModule;
 import com.nextcloud.client.appinfo.AppInfoModule;
 import com.nextcloud.client.database.DatabaseModule;
 import com.nextcloud.client.device.DeviceModule;
-import com.nextcloud.client.files.downloader.FilesDownloadHelper;
+import com.nextcloud.client.files.downloader.FileDownloadHelper;
 import com.nextcloud.client.integrations.IntegrationsModule;
 import com.nextcloud.client.jobs.JobsModule;
 import com.nextcloud.client.network.NetworkModule;
@@ -72,7 +72,7 @@ public interface AppComponent {
 
     void inject(FilesUploadHelper filesUploadHelper);
 
-    void inject(FilesDownloadHelper filesDownloadHelper);
+    void inject(FileDownloadHelper fileDownloadHelper);
 
     void inject(ProgressIndicator progressIndicator);
 

+ 1 - 3
app/src/main/java/com/nextcloud/client/di/ComponentsModule.java

@@ -24,7 +24,7 @@ import com.nextcloud.client.documentscan.DocumentScanActivity;
 import com.nextcloud.client.editimage.EditImageActivity;
 import com.nextcloud.client.etm.EtmActivity;
 import com.nextcloud.client.etm.pages.EtmBackgroundJobsFragment;
-import com.nextcloud.client.files.downloader.FileTransferService;
+import com.nextcloud.client.files.transfer.FileTransferService;
 import com.nextcloud.client.jobs.BackgroundJobManagerImpl;
 import com.nextcloud.client.jobs.NotificationWork;
 import com.nextcloud.client.jobs.TestJob;
@@ -135,8 +135,6 @@ import com.owncloud.android.ui.preview.pdf.PreviewPdfFragment;
 import com.owncloud.android.ui.trashbin.TrashbinActivity;
 import com.owncloud.android.utils.FilesUploadHelper;
 
-import java.io.File;
-
 import dagger.Module;
 import dagger.android.ContributesAndroidInjector;
 

+ 1 - 1
app/src/main/java/com/nextcloud/client/etm/EtmViewModel.kt

@@ -35,7 +35,7 @@ import com.nextcloud.client.etm.pages.EtmBackgroundJobsFragment
 import com.nextcloud.client.etm.pages.EtmFileTransferFragment
 import com.nextcloud.client.etm.pages.EtmMigrations
 import com.nextcloud.client.etm.pages.EtmPreferencesFragment
-import com.nextcloud.client.files.downloader.TransferManagerConnection
+import com.nextcloud.client.files.transfer.TransferManagerConnection
 import com.nextcloud.client.jobs.BackgroundJobManager
 import com.nextcloud.client.jobs.JobInfo
 import com.nextcloud.client.migrations.MigrationInfo

+ 4 - 4
app/src/main/java/com/nextcloud/client/etm/pages/EtmFileTransferFragment.kt

@@ -13,10 +13,10 @@ import androidx.recyclerview.widget.DividerItemDecoration
 import androidx.recyclerview.widget.LinearLayoutManager
 import androidx.recyclerview.widget.RecyclerView
 import com.nextcloud.client.etm.EtmBaseFragment
-import com.nextcloud.client.files.downloader.DownloadRequest
-import com.nextcloud.client.files.downloader.Transfer
-import com.nextcloud.client.files.downloader.TransferManager
-import com.nextcloud.client.files.downloader.UploadRequest
+import com.nextcloud.client.files.DownloadRequest
+import com.nextcloud.client.files.UploadRequest
+import com.nextcloud.client.files.transfer.Transfer
+import com.nextcloud.client.files.transfer.TransferManager
 import com.owncloud.android.R
 import com.owncloud.android.datamodel.OCFile
 import com.owncloud.android.db.OCUpload

+ 1 - 1
app/src/main/java/com/nextcloud/client/files/downloader/Direction.kt → app/src/main/java/com/nextcloud/client/files/Direction.kt

@@ -17,7 +17,7 @@
  * You should have received a copy of the GNU Affero General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files
 
 enum class Direction {
     DOWNLOAD,

+ 7 - 4
app/src/main/java/com/nextcloud/client/files/downloader/Registry.kt → app/src/main/java/com/nextcloud/client/files/Registry.kt

@@ -1,8 +1,9 @@
 /*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2020 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,10 +16,12 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files
 
+import com.nextcloud.client.files.transfer.Transfer
+import com.nextcloud.client.files.transfer.TransferState
 import com.owncloud.android.datamodel.OCFile
 import java.util.UUID
 import kotlin.math.max

+ 7 - 4
app/src/main/java/com/nextcloud/client/files/downloader/Request.kt → app/src/main/java/com/nextcloud/client/files/Request.kt

@@ -1,8 +1,9 @@
 /*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2021 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,13 +16,15 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files
 
 import android.os.Parcel
 import android.os.Parcelable
 import com.nextcloud.client.account.User
+import com.nextcloud.client.files.upload.PostUploadAction
+import com.nextcloud.client.files.upload.UploadTrigger
 import com.owncloud.android.datamodel.OCFile
 import com.owncloud.android.datamodel.UploadsStorageManager
 import com.owncloud.android.db.OCUpload

+ 28 - 21
app/src/main/java/com/nextcloud/client/files/downloader/DownloadTask.kt

@@ -21,7 +21,7 @@ package com.nextcloud.client.files.downloader
 
 import android.content.ContentResolver
 import android.content.Context
-import com.nextcloud.client.core.IsCancelled
+import com.nextcloud.client.files.DownloadRequest
 import com.owncloud.android.datamodel.FileDataStorageManager
 import com.owncloud.android.datamodel.OCFile
 import com.owncloud.android.lib.common.OwnCloudClient
@@ -37,9 +37,9 @@ import java.io.File
  * This design can be regarded as intermediary refactoring step.
  */
 class DownloadTask(
-    val context: Context,
-    val contentResolver: ContentResolver,
-    val clientProvider: () -> OwnCloudClient
+    private val context: Context,
+    private val contentResolver: ContentResolver,
+    private val clientProvider: () -> OwnCloudClient
 ) {
 
     data class Result(val file: OCFile, val success: Boolean)
@@ -62,39 +62,46 @@ class DownloadTask(
         }
     }
 
-    fun download(request: DownloadRequest, progress: (Int) -> Unit, isCancelled: IsCancelled): Result {
+    fun download(request: DownloadRequest): Result {
         val op = DownloadFileOperation(request.user, request.file, context)
         val client = clientProvider.invoke()
         val result = op.execute(client)
-        if (result.isSuccess) {
+
+        return if (result.isSuccess) {
             val storageManager = FileDataStorageManager(
                 request.user,
                 contentResolver
             )
             val file = saveDownloadedFile(op, storageManager)
-            return Result(file, true)
+            Result(file, true)
         } else {
-            return Result(request.file, false)
+            Result(request.file, false)
         }
     }
 
     private fun saveDownloadedFile(op: DownloadFileOperation, storageManager: FileDataStorageManager): OCFile {
-        val file = storageManager.getFileById(op.getFile().getFileId()) as OCFile
-        val syncDate = System.currentTimeMillis()
-        file.lastSyncDateForProperties = syncDate
-        file.lastSyncDateForData = syncDate
-        file.isUpdateThumbnailNeeded = true
-        file.modificationTimestamp = op.getModificationTimestamp()
-        file.modificationTimestampAtLastSyncForData = op.getModificationTimestamp()
-        file.etag = op.getEtag()
-        file.mimeType = op.getMimeType()
-        file.storagePath = op.getSavePath()
-        file.fileLength = File(op.getSavePath()).length()
-        file.remoteId = op.getFile().getRemoteId()
+        val file = storageManager.getFileById(op.file.fileId) as OCFile
+
+        file.apply {
+            val syncDate = System.currentTimeMillis()
+            lastSyncDateForProperties = syncDate
+            lastSyncDateForData = syncDate
+            isUpdateThumbnailNeeded = true
+            modificationTimestamp = op.modificationTimestamp
+            modificationTimestampAtLastSyncForData = op.modificationTimestamp
+            etag = op.etag
+            mimeType = op.mimeType
+            storagePath = op.savePath
+            fileLength = File(op.savePath).length()
+            remoteId = op.file.remoteId
+        }
+
         storageManager.saveFile(file)
-        if (MimeTypeUtil.isMedia(op.getMimeType())) {
+
+        if (MimeTypeUtil.isMedia(op.mimeType)) {
             FileDataStorageManager.triggerMediaScan(file.storagePath)
         }
+
         return file
     }
 }

+ 1 - 1
app/src/main/java/com/nextcloud/client/files/downloader/FilesDownloadHelper.kt → app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadHelper.kt

@@ -33,7 +33,7 @@ import com.owncloud.android.utils.MimeTypeUtil
 import java.io.File
 import javax.inject.Inject
 
-class FilesDownloadHelper {
+class FileDownloadHelper {
 
     @Inject
     lateinit var backgroundJobManager: BackgroundJobManager

+ 10 - 10
app/src/main/java/com/nextcloud/client/files/downloader/FilesDownloadIntents.kt → app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadIntents.kt

@@ -32,16 +32,16 @@ import com.owncloud.android.ui.fragment.OCFileListFragment
 import com.owncloud.android.ui.preview.PreviewImageActivity
 import com.owncloud.android.ui.preview.PreviewImageFragment
 
-class FilesDownloadIntents(private val context: Context) {
+class FileDownloadIntents(private val context: Context) {
 
     fun newDownloadIntent(
         download: DownloadFileOperation,
         linkedToRemotePath: String
     ): Intent {
-        return Intent(FilesDownloadWorker.getDownloadAddedMessage()).apply {
-            putExtra(FilesDownloadWorker.ACCOUNT_NAME, download.user.accountName)
-            putExtra(FilesDownloadWorker.EXTRA_REMOTE_PATH, download.remotePath)
-            putExtra(FilesDownloadWorker.EXTRA_LINKED_TO_PATH, linkedToRemotePath)
+        return Intent(FileDownloadWorker.getDownloadAddedMessage()).apply {
+            putExtra(FileDownloadWorker.ACCOUNT_NAME, download.user.accountName)
+            putExtra(FileDownloadWorker.EXTRA_REMOTE_PATH, download.remotePath)
+            putExtra(FileDownloadWorker.EXTRA_LINKED_TO_PATH, linkedToRemotePath)
             setPackage(context.packageName)
         }
     }
@@ -51,15 +51,15 @@ class FilesDownloadIntents(private val context: Context) {
         downloadResult: RemoteOperationResult<*>,
         unlinkedFromRemotePath: String?
     ): Intent {
-        return Intent(FilesDownloadWorker.getDownloadFinishMessage()).apply {
-            putExtra(FilesDownloadWorker.EXTRA_DOWNLOAD_RESULT, downloadResult.isSuccess)
-            putExtra(FilesDownloadWorker.ACCOUNT_NAME, download.user.accountName)
-            putExtra(FilesDownloadWorker.EXTRA_REMOTE_PATH, download.remotePath)
+        return Intent(FileDownloadWorker.getDownloadFinishMessage()).apply {
+            putExtra(FileDownloadWorker.EXTRA_DOWNLOAD_RESULT, downloadResult.isSuccess)
+            putExtra(FileDownloadWorker.ACCOUNT_NAME, download.user.accountName)
+            putExtra(FileDownloadWorker.EXTRA_REMOTE_PATH, download.remotePath)
             putExtra(OCFileListFragment.DOWNLOAD_BEHAVIOUR, download.behaviour)
             putExtra(SendShareDialog.ACTIVITY_NAME, download.activityName)
             putExtra(SendShareDialog.PACKAGE_NAME, download.packageName)
             if (unlinkedFromRemotePath != null) {
-                putExtra(FilesDownloadWorker.EXTRA_LINKED_TO_PATH, unlinkedFromRemotePath)
+                putExtra(FileDownloadWorker.EXTRA_LINKED_TO_PATH, unlinkedFromRemotePath)
             }
             setPackage(context.packageName)
         }

+ 6 - 6
app/src/main/java/com/nextcloud/client/files/downloader/FilesDownloadWorker.kt → app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt

@@ -55,7 +55,7 @@ import java.util.AbstractList
 import java.util.Vector
 
 @Suppress("LongParameterList")
-class FilesDownloadWorker(
+class FileDownloadWorker(
     private val viewThemeUtils: ViewThemeUtils,
     private val accountManager: UserAccountManager,
     private val uploadsStorageManager: UploadsStorageManager,
@@ -65,7 +65,7 @@ class FilesDownloadWorker(
 ) : Worker(context, params), OnAccountsUpdateListener, OnDatatransferProgressListener {
 
     companion object {
-        private val TAG = FilesDownloadWorker::class.java.simpleName
+        private val TAG = FileDownloadWorker::class.java.simpleName
 
         const val USER_NAME = "USER"
         const val FILE = "FILE"
@@ -82,23 +82,23 @@ class FilesDownloadWorker(
         const val ACCOUNT_NAME = "ACCOUNT_NAME"
 
         fun getDownloadAddedMessage(): String {
-            return FilesDownloadWorker::class.java.name + "DOWNLOAD_ADDED"
+            return FileDownloadWorker::class.java.name + "DOWNLOAD_ADDED"
         }
 
         fun getDownloadFinishMessage(): String {
-            return FilesDownloadWorker::class.java.name + "DOWNLOAD_FINISH"
+            return FileDownloadWorker::class.java.name + "DOWNLOAD_FINISH"
         }
     }
 
     private var currentDownload: DownloadFileOperation? = null
     private var conflictUploadId: Long? = null
     private var lastPercent = 0
-    private val intents = FilesDownloadIntents(context)
+    private val intents = FileDownloadIntents(context)
     private val notificationManager = DownloadNotificationManager(context, viewThemeUtils)
     private val pendingDownloads = IndexedForest<DownloadFileOperation>()
     private var downloadBinder: IBinder = FileDownloaderBinder()
     private var currentUser = Optional.empty<User>()
-    private val helper = FilesDownloadHelper()
+    private val helper = FileDownloadHelper()
     private var startedDownload = false
     private var storageManager: FileDataStorageManager? = null
     private var downloadClient: OwnCloudClient? = null

+ 9 - 4
app/src/main/java/com/nextcloud/client/files/downloader/FileTransferService.kt → app/src/main/java/com/nextcloud/client/files/transfer/FileTransferService.kt

@@ -1,8 +1,9 @@
 /*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2021 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,9 +16,9 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.transfer
 
 import android.app.Service
 import android.content.Context
@@ -27,6 +28,10 @@ import com.nextcloud.client.account.User
 import com.nextcloud.client.core.AsyncRunner
 import com.nextcloud.client.core.LocalBinder
 import com.nextcloud.client.device.PowerManagementService
+import com.nextcloud.client.files.Direction
+import com.nextcloud.client.files.Request
+import com.nextcloud.client.files.downloader.DownloadTask
+import com.nextcloud.client.files.upload.UploadTask
 import com.nextcloud.client.logger.Logger
 import com.nextcloud.client.network.ClientFactory
 import com.nextcloud.client.network.ConnectivityService

+ 15 - 9
app/src/main/java/com/nextcloud/client/files/downloader/Transfer.kt → app/src/main/java/com/nextcloud/client/files/transfer/Transfer.kt

@@ -1,8 +1,9 @@
-/**
+/*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2021 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,10 +16,14 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.transfer
 
+import com.nextcloud.client.files.Direction
+import com.nextcloud.client.files.DownloadRequest
+import com.nextcloud.client.files.Request
+import com.nextcloud.client.files.UploadRequest
 import com.owncloud.android.datamodel.OCFile
 import java.util.UUID
 
@@ -48,8 +53,9 @@ data class Transfer(
      */
     val isFinished: Boolean get() = state == TransferState.COMPLETED || state == TransferState.FAILED
 
-    val direction: Direction get() = when (request) {
-        is DownloadRequest -> Direction.DOWNLOAD
-        is UploadRequest -> Direction.UPLOAD
-    }
+    val direction: Direction
+        get() = when (request) {
+            is DownloadRequest -> Direction.DOWNLOAD
+            is UploadRequest -> Direction.UPLOAD
+        }
 }

+ 7 - 5
app/src/main/java/com/nextcloud/client/files/downloader/TransferManager.kt → app/src/main/java/com/nextcloud/client/files/transfer/TransferManager.kt

@@ -1,8 +1,9 @@
-/**
+/*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2021 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,10 +16,11 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.transfer
 
+import com.nextcloud.client.files.Request
 import com.owncloud.android.datamodel.OCFile
 import java.util.UUID
 

+ 7 - 5
app/src/main/java/com/nextcloud/client/files/downloader/TransferManagerConnection.kt → app/src/main/java/com/nextcloud/client/files/transfer/TransferManagerConnection.kt

@@ -1,8 +1,9 @@
-/**
+/*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2020 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,15 +16,16 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.transfer
 
 import android.content.Context
 import android.content.Intent
 import android.os.IBinder
 import com.nextcloud.client.account.User
 import com.nextcloud.client.core.LocalConnection
+import com.nextcloud.client.files.Request
 import com.owncloud.android.datamodel.OCFile
 import java.util.UUID
 

+ 14 - 7
app/src/main/java/com/nextcloud/client/files/downloader/TransferManagerImpl.kt → app/src/main/java/com/nextcloud/client/files/transfer/TransferManagerImpl.kt

@@ -1,8 +1,9 @@
 /*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2020 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,14 +16,20 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.transfer
 
 import com.nextcloud.client.core.AsyncRunner
 import com.nextcloud.client.core.IsCancelled
 import com.nextcloud.client.core.OnProgressCallback
 import com.nextcloud.client.core.TaskFunction
+import com.nextcloud.client.files.DownloadRequest
+import com.nextcloud.client.files.Registry
+import com.nextcloud.client.files.Request
+import com.nextcloud.client.files.UploadRequest
+import com.nextcloud.client.files.downloader.DownloadTask
+import com.nextcloud.client.files.upload.UploadTask
 import com.owncloud.android.datamodel.OCFile
 import com.owncloud.android.operations.UploadFileOperation
 import java.util.UUID
@@ -131,8 +138,8 @@ class TransferManagerImpl(
             }
         } else {
             val downloadTask = downloadTaskFactory.create()
-            val wrapper: TaskFunction<DownloadTask.Result, Int> = { progress: ((Int) -> Unit), isCancelled ->
-                downloadTask.download(request, progress, isCancelled)
+            val wrapper: TaskFunction<DownloadTask.Result, Int> = { _: ((Int) -> Unit), _ ->
+                downloadTask.download(request)
             }
             wrapper
         }
@@ -150,7 +157,7 @@ class TransferManagerImpl(
             }
         } else {
             val uploadTask = uploadTaskFactory.create()
-            val wrapper: TaskFunction<UploadTask.Result, Int> = { progress: ((Int) -> Unit), isCancelled ->
+            val wrapper: TaskFunction<UploadTask.Result, Int> = { _: ((Int) -> Unit), _ ->
                 uploadTask.upload(request.user, request.upload)
             }
             wrapper

+ 1 - 1
app/src/main/java/com/nextcloud/client/files/downloader/TransferState.kt → app/src/main/java/com/nextcloud/client/files/transfer/TransferState.kt

@@ -17,7 +17,7 @@
  * You should have received a copy of the GNU Affero General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.transfer
 
 enum class TransferState {
     PENDING,

+ 1 - 1
app/src/main/java/com/nextcloud/client/files/downloader/PostUploadAction.kt → app/src/main/java/com/nextcloud/client/files/upload/PostUploadAction.kt

@@ -17,7 +17,7 @@
  * You should have received a copy of the GNU Affero General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.upload
 
 import com.owncloud.android.files.services.FileUploader
 

+ 5 - 4
app/src/main/java/com/nextcloud/client/files/downloader/UploadTask.kt → app/src/main/java/com/nextcloud/client/files/upload/UploadTask.kt

@@ -1,8 +1,9 @@
 /*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2021 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,9 +16,9 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.upload
 
 import android.content.Context
 import com.nextcloud.client.account.User

+ 5 - 4
app/src/main/java/com/nextcloud/client/files/downloader/UploadTrigger.kt → app/src/main/java/com/nextcloud/client/files/upload/UploadTrigger.kt

@@ -1,8 +1,9 @@
 /*
  * Nextcloud Android client application
  *
- * @author Chris Narkiewicz
- * Copyright (C) 2021 Chris Narkiewicz <hello@ezaquarii.com>
+ * @author Alper Ozturk
+ * Copyright (C) 2023 Alper Ozturk
+ * Copyright (C) 2023 Nextcloud GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -15,9 +16,9 @@
  * GNU Affero General Public License for more details.
  *
  * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
-package com.nextcloud.client.files.downloader
+package com.nextcloud.client.files.upload
 
 import com.owncloud.android.operations.UploadFileOperation
 

+ 4 - 4
app/src/main/java/com/nextcloud/client/jobs/BackgroundJobFactory.kt

@@ -34,7 +34,7 @@ import com.nextcloud.client.device.DeviceInfo
 import com.nextcloud.client.device.PowerManagementService
 import com.nextcloud.client.documentscan.GeneratePDFUseCase
 import com.nextcloud.client.documentscan.GeneratePdfFromImagesWork
-import com.nextcloud.client.files.downloader.FilesDownloadWorker
+import com.nextcloud.client.files.downloader.FileDownloadWorker
 import com.nextcloud.client.integrations.deck.DeckApi
 import com.nextcloud.client.logger.Logger
 import com.nextcloud.client.network.ConnectivityService
@@ -103,7 +103,7 @@ class BackgroundJobFactory @Inject constructor(
                 CalendarImportWork::class -> createCalendarImportWork(context, workerParameters)
                 FilesExportWork::class -> createFilesExportWork(context, workerParameters)
                 FilesUploadWorker::class -> createFilesUploadWorker(context, workerParameters)
-                FilesDownloadWorker::class -> createFilesDownloadWorker(context, workerParameters)
+                FileDownloadWorker::class -> createFilesDownloadWorker(context, workerParameters)
                 GeneratePdfFromImagesWork::class -> createPDFGenerateWork(context, workerParameters)
                 HealthStatusWork::class -> createHealthStatusWork(context, workerParameters)
                 TestJob::class -> createTestJob(context, workerParameters)
@@ -255,8 +255,8 @@ class BackgroundJobFactory @Inject constructor(
         )
     }
 
-    private fun createFilesDownloadWorker(context: Context, params: WorkerParameters): FilesDownloadWorker {
-        return FilesDownloadWorker(
+    private fun createFilesDownloadWorker(context: Context, params: WorkerParameters): FileDownloadWorker {
+        return FileDownloadWorker(
             viewThemeUtils.get(),
             accountManager,
             uploadsStorageManager,

+ 9 - 9
app/src/main/java/com/nextcloud/client/jobs/BackgroundJobManagerImpl.kt

@@ -39,7 +39,7 @@ import com.nextcloud.client.account.User
 import com.nextcloud.client.core.Clock
 import com.nextcloud.client.di.Injectable
 import com.nextcloud.client.documentscan.GeneratePdfFromImagesWork
-import com.nextcloud.client.files.downloader.FilesDownloadWorker
+import com.nextcloud.client.files.downloader.FileDownloadWorker
 import com.nextcloud.client.preferences.AppPreferences
 import com.owncloud.android.datamodel.OCFile
 import com.owncloud.android.operations.DownloadType
@@ -521,16 +521,16 @@ internal class BackgroundJobManagerImpl(
         val gson = Gson()
 
         val data = workDataOf(
-            FilesDownloadWorker.USER_NAME to user.accountName,
-            FilesDownloadWorker.FILE to gson.toJson(ocFile),
-            FilesDownloadWorker.BEHAVIOUR to behaviour,
-            FilesDownloadWorker.DOWNLOAD_TYPE to downloadType.toString(),
-            FilesDownloadWorker.ACTIVITY_NAME to activityName,
-            FilesDownloadWorker.PACKAGE_NAME to packageName,
-            FilesDownloadWorker.CONFLICT_UPLOAD_ID to conflictUploadId
+            FileDownloadWorker.USER_NAME to user.accountName,
+            FileDownloadWorker.FILE to gson.toJson(ocFile),
+            FileDownloadWorker.BEHAVIOUR to behaviour,
+            FileDownloadWorker.DOWNLOAD_TYPE to downloadType.toString(),
+            FileDownloadWorker.ACTIVITY_NAME to activityName,
+            FileDownloadWorker.PACKAGE_NAME to packageName,
+            FileDownloadWorker.CONFLICT_UPLOAD_ID to conflictUploadId
         )
 
-        val request = oneTimeRequestBuilder(FilesDownloadWorker::class, JOB_FILES_DOWNLOAD, user)
+        val request = oneTimeRequestBuilder(FileDownloadWorker::class, JOB_FILES_DOWNLOAD, user)
             .setInputData(data)
             .build()
 

+ 4 - 4
app/src/main/java/com/nextcloud/client/jobs/ContactsBackupWork.kt

@@ -35,10 +35,10 @@ import androidx.work.Worker
 import androidx.work.WorkerParameters
 import com.nextcloud.client.account.User
 import com.nextcloud.client.account.UserAccountManager
-import com.nextcloud.client.files.downloader.PostUploadAction
-import com.nextcloud.client.files.downloader.TransferManagerConnection
-import com.nextcloud.client.files.downloader.UploadRequest
-import com.nextcloud.client.files.downloader.UploadTrigger
+import com.nextcloud.client.files.UploadRequest
+import com.nextcloud.client.files.transfer.TransferManagerConnection
+import com.nextcloud.client.files.upload.PostUploadAction
+import com.nextcloud.client.files.upload.UploadTrigger
 import com.owncloud.android.R
 import com.owncloud.android.datamodel.ArbitraryDataProvider
 import com.owncloud.android.datamodel.FileDataStorageManager

+ 2 - 2
app/src/main/java/com/nextcloud/client/jobs/FilesExportWork.kt

@@ -33,7 +33,7 @@ import androidx.core.app.NotificationCompat
 import androidx.work.Worker
 import androidx.work.WorkerParameters
 import com.nextcloud.client.account.User
-import com.nextcloud.client.files.downloader.FilesDownloadHelper
+import com.nextcloud.client.files.downloader.FileDownloadHelper
 import com.owncloud.android.R
 import com.owncloud.android.datamodel.FileDataStorageManager
 import com.owncloud.android.datamodel.OCFile
@@ -111,7 +111,7 @@ class FilesExportWork(
     }
 
     private fun downloadFile(ocFile: OCFile) {
-        FilesDownloadHelper().downloadFile(
+        FileDownloadHelper().downloadFile(
             user,
             ocFile,
             DownloadType.EXPORT

+ 3 - 3
app/src/main/java/com/owncloud/android/files/FileMenuFilter.java

@@ -31,7 +31,7 @@ import android.view.Menu;
 import com.nextcloud.android.files.FileLockingHelper;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.editimage.EditImageActivity;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.nextcloud.utils.EditorUtils;
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.FileDataStorageManager;
@@ -380,7 +380,7 @@ public class FileMenuFilter {
         if (componentsGetter != null && !files.isEmpty() && user != null) {
             OperationsServiceBinder opsBinder = componentsGetter.getOperationsServiceBinder();
             FileUploaderBinder uploaderBinder = componentsGetter.getFileUploaderBinder();
-            FilesDownloadWorker.FileDownloaderBinder downloaderBinder = componentsGetter.getFileDownloaderBinder();
+            FileDownloadWorker.FileDownloaderBinder downloaderBinder = componentsGetter.getFileDownloaderBinder();
             synchronizing = anyFileSynchronizing(opsBinder) ||      // comparing local and remote
                             anyFileDownloading(downloaderBinder) ||
                             anyFileUploading(uploaderBinder);
@@ -398,7 +398,7 @@ public class FileMenuFilter {
         return synchronizing;
     }
 
-    private boolean anyFileDownloading(FilesDownloadWorker.FileDownloaderBinder downloaderBinder) {
+    private boolean anyFileDownloading(FileDownloadWorker.FileDownloaderBinder downloaderBinder) {
         boolean downloading = false;
         if (downloaderBinder != null) {
             for (Iterator<OCFile> iterator = files.iterator(); !downloading && iterator.hasNext(); ) {

+ 2 - 2
app/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java

@@ -25,7 +25,7 @@ import android.content.Context;
 import android.text.TextUtils;
 
 import com.nextcloud.client.account.User;
-import com.nextcloud.client.files.downloader.FilesDownloadHelper;
+import com.nextcloud.client.files.downloader.FileDownloadHelper;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.FileUploader;
@@ -316,7 +316,7 @@ public class SynchronizeFileOperation extends SyncOperation {
      * @param file OCFile object representing the file to download
      */
     private void requestForDownload(OCFile file) {
-        FilesDownloadHelper downloadHelper = new FilesDownloadHelper();
+        FileDownloadHelper downloadHelper = new FileDownloadHelper();
 
         downloadHelper.downloadFile(
             mUser,

+ 2 - 2
app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java

@@ -25,7 +25,7 @@ import android.content.Intent;
 import android.text.TextUtils;
 
 import com.nextcloud.client.account.User;
-import com.nextcloud.client.files.downloader.FilesDownloadHelper;
+import com.nextcloud.client.files.downloader.FileDownloadHelper;
 import com.owncloud.android.datamodel.DecryptedFolderMetadata;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
@@ -452,7 +452,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
                     throw new OperationCancelledException();
                 }
 
-                FilesDownloadHelper downloadHelper = new FilesDownloadHelper();
+                FileDownloadHelper downloadHelper = new FileDownloadHelper();
 
                 downloadHelper.downloadFile(user, file);
             }

+ 1 - 1
app/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java

@@ -307,7 +307,7 @@ public class DocumentsStorageProvider extends DocumentsProvider {
     /**
      * Updates the OC File after a successful download.
      *
-     * TODO unify with code from {@link com.nextcloud.client.files.downloader.FilesDownloadWorker} and {@link DownloadTask}.
+     * TODO unify with code from {@link com.nextcloud.client.files.downloader.FileDownloadWorker} and {@link DownloadTask}.
      */
     private void saveDownloadedFile(FileDataStorageManager storageManager, DownloadFileOperation dfo, OCFile file) {
         long syncDate = System.currentTimeMillis();

+ 8 - 8
app/src/main/java/com/owncloud/android/services/SyncFolderHandler.java

@@ -28,7 +28,7 @@ import android.os.Message;
 import android.util.Pair;
 
 import com.nextcloud.client.account.User;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.IndexedForest;
 import com.owncloud.android.lib.common.OwnCloudAccount;
@@ -169,9 +169,9 @@ class SyncFolderHandler extends Handler {
      * this is a fast and ugly patch.
      */
     private void sendBroadcastNewSyncFolder(Account account, String remotePath) {
-        Intent added = new Intent(FilesDownloadWorker.Companion.getDownloadAddedMessage());
-        added.putExtra(FilesDownloadWorker.ACCOUNT_NAME, account.name);
-        added.putExtra(FilesDownloadWorker.EXTRA_REMOTE_PATH, remotePath);
+        Intent added = new Intent(FileDownloadWorker.Companion.getDownloadAddedMessage());
+        added.putExtra(FileDownloadWorker.ACCOUNT_NAME, account.name);
+        added.putExtra(FileDownloadWorker.EXTRA_REMOTE_PATH, remotePath);
         added.setPackage(mService.getPackageName());
         LocalBroadcastManager.getInstance(mService.getApplicationContext()).sendBroadcast(added);
     }
@@ -182,10 +182,10 @@ class SyncFolderHandler extends Handler {
      */
     private void sendBroadcastFinishedSyncFolder(Account account, String remotePath,
                                                  boolean success) {
-        Intent finished = new Intent(FilesDownloadWorker.Companion.getDownloadFinishMessage());
-        finished.putExtra(FilesDownloadWorker.ACCOUNT_NAME, account.name);
-        finished.putExtra(FilesDownloadWorker.EXTRA_REMOTE_PATH, remotePath);
-        finished.putExtra(FilesDownloadWorker.EXTRA_DOWNLOAD_RESULT, success);
+        Intent finished = new Intent(FileDownloadWorker.Companion.getDownloadFinishMessage());
+        finished.putExtra(FileDownloadWorker.ACCOUNT_NAME, account.name);
+        finished.putExtra(FileDownloadWorker.EXTRA_REMOTE_PATH, remotePath);
+        finished.putExtra(FileDownloadWorker.EXTRA_DOWNLOAD_RESULT, success);
         finished.setPackage(mService.getPackageName());
         LocalBroadcastManager.getInstance(mService.getApplicationContext()).sendBroadcast(finished);
     }

+ 2 - 2
app/src/main/java/com/owncloud/android/ui/activity/ComponentsGetter.java

@@ -20,7 +20,7 @@
 
 package com.owncloud.android.ui.activity;
 
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
 import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
@@ -32,7 +32,7 @@ public interface ComponentsGetter {
      * To be invoked when the parent activity is fully created to get a reference
      * to the FileDownloadWorker.
      */
-    public FilesDownloadWorker.FileDownloaderBinder getFileDownloaderBinder();
+    public FileDownloadWorker.FileDownloaderBinder getFileDownloaderBinder();
 
     
     /**

+ 2 - 2
app/src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.kt

@@ -21,7 +21,7 @@ import android.content.Intent
 import android.os.Bundle
 import android.widget.Toast
 import com.nextcloud.client.account.User
-import com.nextcloud.client.files.downloader.FilesDownloadHelper
+import com.nextcloud.client.files.downloader.FileDownloadHelper
 import com.nextcloud.model.HTTPStatusCodes
 import com.nextcloud.utils.extensions.getParcelableArgument
 import com.owncloud.android.R
@@ -115,7 +115,7 @@ class ConflictsResolveActivity : FileActivity(), OnConflictDecisionMadeListener
                 Decision.KEEP_SERVER -> if (!shouldDeleteLocal()) {
                     // Overwrite local file
                     file?.let {
-                        FilesDownloadHelper().downloadFile(
+                        FileDownloadHelper().downloadFile(
                             getUser().orElseThrow { RuntimeException() },
                             file,
                             conflictUploadId

+ 5 - 5
app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java

@@ -43,8 +43,8 @@ import android.text.TextUtils;
 import com.google.android.material.snackbar.Snackbar;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.account.UserAccountManager;
-import com.nextcloud.client.files.downloader.FilesDownloadHelper;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadHelper;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.nextcloud.client.jobs.BackgroundJobManager;
 import com.nextcloud.client.network.ConnectivityService;
 import com.nextcloud.utils.EditorUtils;
@@ -166,7 +166,7 @@ public abstract class FileActivity extends DrawerActivity
 
     private boolean mResumed;
 
-    protected FilesDownloadWorker.FileDownloaderBinder mDownloaderBinder;
+    protected FileDownloadWorker.FileDownloaderBinder mDownloaderBinder;
     protected FileUploaderBinder mUploaderBinder;
     private ServiceConnection mUploadServiceConnection;
 
@@ -234,7 +234,7 @@ public abstract class FileActivity extends DrawerActivity
                 Context.BIND_AUTO_CREATE);
 
         if (user != null) {
-            new FilesDownloadHelper().downloadFile(user, mFile);
+            new FileDownloadHelper().downloadFile(user, mFile);
         }
 
         mUploadServiceConnection = newTransferenceServiceConnection();
@@ -612,7 +612,7 @@ public abstract class FileActivity extends DrawerActivity
     }
 
     @Override
-    public FilesDownloadWorker.FileDownloaderBinder getFileDownloaderBinder() {
+    public FileDownloadWorker.FileDownloaderBinder getFileDownloaderBinder() {
         return mDownloaderBinder;
     }
 

+ 16 - 16
app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -65,8 +65,8 @@ import com.nextcloud.client.core.AsyncRunner;
 import com.nextcloud.client.di.Injectable;
 import com.nextcloud.client.editimage.EditImageActivity;
 import com.nextcloud.client.files.DeepLinkHandler;
-import com.nextcloud.client.files.downloader.FilesDownloadHelper;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadHelper;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.nextcloud.client.media.PlayerServiceConnection;
 import com.nextcloud.client.network.ClientFactory;
 import com.nextcloud.client.network.ConnectivityService;
@@ -685,12 +685,12 @@ public class FileDisplayActivity extends FileActivity
                 // the user browsed to other file ; forget the automatic preview
                 mWaitingToPreview = null;
 
-            } else if (downloadEvent.equals(FilesDownloadWorker.Companion.getDownloadAddedMessage())) {
+            } else if (downloadEvent.equals(FileDownloadWorker.Companion.getDownloadAddedMessage())) {
                 // grant that the details fragment updates the progress bar
                 detailsFragment.listenForTransferProgress();
                 detailsFragment.updateFileDetails(true, false);
 
-            } else if (downloadEvent.equals(FilesDownloadWorker.Companion.getDownloadFinishMessage())) {
+            } else if (downloadEvent.equals(FileDownloadWorker.Companion.getDownloadFinishMessage())) {
                 //  update the details panel
                 boolean detailsFragmentChanged = false;
                 if (waitedPreview) {
@@ -1116,8 +1116,8 @@ public class FileDisplayActivity extends FileActivity
         localBroadcastManager.registerReceiver(mUploadFinishReceiver, uploadIntentFilter);
 
         // Listen for download messages
-        IntentFilter downloadIntentFilter = new IntentFilter(FilesDownloadWorker.Companion.getDownloadAddedMessage());
-        downloadIntentFilter.addAction(FilesDownloadWorker.Companion.getDownloadFinishMessage());
+        IntentFilter downloadIntentFilter = new IntentFilter(FileDownloadWorker.Companion.getDownloadAddedMessage());
+        downloadIntentFilter.addAction(FileDownloadWorker.Companion.getDownloadFinishMessage());
         mDownloadFinishReceiver = new DownloadFinishReceiver();
         localBroadcastManager.registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);
 
@@ -1418,7 +1418,7 @@ public class FileDisplayActivity extends FileActivity
 
 
     /**
-     * Class waiting for broadcast events from the {@link FilesDownloadWorker} service.
+     * Class waiting for broadcast events from the {@link FileDownloadWorker} service.
      * <p>
      * Updates the UI when a download is started or finished, provided that it is relevant for the current folder.
      */
@@ -1427,16 +1427,16 @@ public class FileDisplayActivity extends FileActivity
         @Override
         public void onReceive(Context context, Intent intent) {
             boolean sameAccount = isSameAccount(intent);
-            String downloadedRemotePath = intent.getStringExtra(FilesDownloadWorker.EXTRA_REMOTE_PATH);
+            String downloadedRemotePath = intent.getStringExtra(FileDownloadWorker.EXTRA_REMOTE_PATH);
             String downloadBehaviour = intent.getStringExtra(OCFileListFragment.DOWNLOAD_BEHAVIOUR);
             boolean isDescendant = isDescendant(downloadedRemotePath);
 
             if (sameAccount && isDescendant) {
-                String linkedToRemotePath = intent.getStringExtra(FilesDownloadWorker.EXTRA_LINKED_TO_PATH);
+                String linkedToRemotePath = intent.getStringExtra(FileDownloadWorker.EXTRA_LINKED_TO_PATH);
                 if (linkedToRemotePath == null || isAscendant(linkedToRemotePath)) {
                     updateListOfFilesFragment(false);
                 }
-                refreshDetailsFragmentIfVisible(intent.getAction(), downloadedRemotePath, intent.getBooleanExtra(FilesDownloadWorker.EXTRA_DOWNLOAD_RESULT, false));
+                refreshDetailsFragmentIfVisible(intent.getAction(), downloadedRemotePath, intent.getBooleanExtra(FileDownloadWorker.EXTRA_DOWNLOAD_RESULT, false));
             }
 
             if (mWaitingToSend != null) {
@@ -1469,7 +1469,7 @@ public class FileDisplayActivity extends FileActivity
         }
 
         private boolean isSameAccount(Intent intent) {
-            String accountName = intent.getStringExtra(FilesDownloadWorker.ACCOUNT_NAME);
+            String accountName = intent.getStringExtra(FileDownloadWorker.ACCOUNT_NAME);
             return accountName != null && getAccount() != null && accountName.equals(getAccount().name);
         }
     }
@@ -1571,9 +1571,9 @@ public class FileDisplayActivity extends FileActivity
 
         @Override
         public void onServiceConnected(ComponentName component, IBinder service) {
-            if (component.equals(new ComponentName(FileDisplayActivity.this, FilesDownloadWorker.class))) {
+            if (component.equals(new ComponentName(FileDisplayActivity.this, FileDownloadWorker.class))) {
                 Log_OC.d(TAG, "Download service connected");
-                mDownloaderBinder = (FilesDownloadWorker.FileDownloaderBinder) service;
+                mDownloaderBinder = (FileDownloadWorker.FileDownloaderBinder) service;
                 if (mWaitingToPreview != null && getStorageManager() != null) {
                     // update the file
                     mWaitingToPreview = getStorageManager().getFileById(mWaitingToPreview.getFileId());
@@ -1604,7 +1604,7 @@ public class FileDisplayActivity extends FileActivity
 
         @Override
         public void onServiceDisconnected(ComponentName component) {
-            if (component.equals(new ComponentName(FileDisplayActivity.this, FilesDownloadWorker.class))) {
+            if (component.equals(new ComponentName(FileDisplayActivity.this, FileDownloadWorker.class))) {
                 Log_OC.d(TAG, "Download service disconnected");
                 mDownloaderBinder = null;
             } else if (component.equals(new ComponentName(FileDisplayActivity.this, FileUploader.class))) {
@@ -1886,7 +1886,7 @@ public class FileDisplayActivity extends FileActivity
         User user = getUser().orElseThrow(RuntimeException::new);
         //if (!mWaitingToPreview.isDownloading()) {
         if (!mDownloaderBinder.isDownloading(user, mWaitingToPreview)) {
-            new FilesDownloadHelper().downloadFile(user, mWaitingToPreview);
+            new FileDownloadHelper().downloadFile(user, mWaitingToPreview);
         }
     }
 
@@ -1958,7 +1958,7 @@ public class FileDisplayActivity extends FileActivity
     private void requestForDownload(OCFile file, String downloadBehaviour, String packageName, String activityName) {
         final User currentUser = getUser().orElseThrow(RuntimeException::new);
         if (!mDownloaderBinder.isDownloading(currentUser, mWaitingToPreview)) {
-            new FilesDownloadHelper().downloadFile(currentUser, file, downloadBehaviour, DownloadType.DOWNLOAD, activityName, packageName, null);
+            new FileDownloadHelper().downloadFile(currentUser, file, downloadBehaviour, DownloadType.DOWNLOAD, activityName, packageName, null);
         }
     }
 

+ 4 - 4
app/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java

@@ -41,7 +41,7 @@ import android.view.View;
 import com.google.common.collect.Sets;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.account.UserAccountManager;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.nextcloud.client.jobs.BackgroundJobManager;
 import com.nextcloud.client.onboarding.FirstRunActivity;
 import com.nextcloud.java.util.Optional;
@@ -525,8 +525,8 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
         @Override
         public void onServiceConnected(ComponentName component, IBinder service) {
 
-            if (component.equals(new ComponentName(ManageAccountsActivity.this, FilesDownloadWorker.class))) {
-                mDownloaderBinder = (FilesDownloadWorker.FileDownloaderBinder) service;
+            if (component.equals(new ComponentName(ManageAccountsActivity.this, FileDownloadWorker.class))) {
+                mDownloaderBinder = (FileDownloadWorker.FileDownloaderBinder) service;
 
             } else if (component.equals(new ComponentName(ManageAccountsActivity.this, FileUploader.class))) {
                 Log_OC.d(TAG, "Upload service connected");
@@ -536,7 +536,7 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
 
         @Override
         public void onServiceDisconnected(ComponentName component) {
-            if (component.equals(new ComponentName(ManageAccountsActivity.this, FilesDownloadWorker.class))) {
+            if (component.equals(new ComponentName(ManageAccountsActivity.this, FileDownloadWorker.class))) {
                 Log_OC.d(TAG, "Download service suddenly disconnected");
                 mDownloaderBinder = null;
             } else if (component.equals(new ComponentName(ManageAccountsActivity.this, FileUploader.class))) {

+ 4 - 4
app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

@@ -44,7 +44,7 @@ import com.google.android.material.tabs.TabLayout;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.account.UserAccountManager;
 import com.nextcloud.client.di.Injectable;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.nextcloud.client.jobs.BackgroundJobManager;
 import com.nextcloud.client.network.ClientFactory;
 import com.nextcloud.client.network.ConnectivityService;
@@ -502,7 +502,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
      * TODO Remove parameter when the transferring state of files is kept in database.
      *
      * @param transferring Flag signaling if the file should be considered as downloading or uploading, although
-     *                     {@link com.nextcloud.client.files.downloader.FilesDownloadWorker.FileDownloaderBinder#isDownloading(User, OCFile)}  and
+     *                     {@link com.nextcloud.client.files.downloader.FileDownloadWorker.FileDownloaderBinder#isDownloading(User, OCFile)}  and
      *                     {@link FileUploaderBinder#isUploading(User, OCFile)} return false.
      * @param refresh      If 'true', try to refresh the whole file from the database
      */
@@ -534,7 +534,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
             setFavoriteIconStatus(file.isFavorite());
 
             // configure UI for depending upon local state of the file
-            FilesDownloadWorker.FileDownloaderBinder downloaderBinder = containerActivity.getFileDownloaderBinder();
+            FileDownloadWorker.FileDownloaderBinder downloaderBinder = containerActivity.getFileDownloaderBinder();
             FileUploaderBinder uploaderBinder = containerActivity.getFileUploaderBinder();
             if (transferring
                 || (downloaderBinder != null && downloaderBinder.isDownloading(user, file))
@@ -659,7 +659,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
             // show the progress bar for the transfer
             binding.progressBlock.setVisibility(View.VISIBLE);
             binding.progressText.setVisibility(View.VISIBLE);
-            FilesDownloadWorker.FileDownloaderBinder downloaderBinder = containerActivity.getFileDownloaderBinder();
+            FileDownloadWorker.FileDownloaderBinder downloaderBinder = containerActivity.getFileDownloaderBinder();
             FileUploaderBinder uploaderBinder = containerActivity.getFileUploaderBinder();
             //if (getFile().isDownloading()) {
             if (downloaderBinder != null && downloaderBinder.isDownloading(user, getFile())) {

+ 0 - 1
app/src/main/java/com/owncloud/android/ui/fragment/FileFragment.java

@@ -21,7 +21,6 @@
 
 package com.owncloud.android.ui.fragment;
 
-import android.accounts.Account;
 import android.app.Activity;
 import android.os.Bundle;
 

+ 5 - 5
app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupListFragment.java

@@ -38,11 +38,11 @@ import com.google.android.material.snackbar.Snackbar;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.account.UserAccountManager;
 import com.nextcloud.client.di.Injectable;
-import com.nextcloud.client.files.downloader.DownloadRequest;
-import com.nextcloud.client.files.downloader.Request;
-import com.nextcloud.client.files.downloader.Transfer;
-import com.nextcloud.client.files.downloader.TransferManagerConnection;
-import com.nextcloud.client.files.downloader.TransferState;
+import com.nextcloud.client.files.DownloadRequest;
+import com.nextcloud.client.files.Request;
+import com.nextcloud.client.files.transfer.Transfer;
+import com.nextcloud.client.files.transfer.TransferManagerConnection;
+import com.nextcloud.client.files.transfer.TransferState;
 import com.nextcloud.client.jobs.BackgroundJobManager;
 import com.nextcloud.client.network.ClientFactory;
 import com.nextcloud.utils.extensions.BundleExtensionsKt;

+ 2 - 2
app/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java

@@ -47,7 +47,7 @@ import android.webkit.MimeTypeMap;
 
 import com.nextcloud.client.account.CurrentAccountProvider;
 import com.nextcloud.client.account.User;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.nextcloud.client.jobs.BackgroundJobManager;
 import com.nextcloud.client.network.ConnectivityService;
 import com.nextcloud.java.util.Optional;
@@ -997,7 +997,7 @@ public class FileOperationsHelper {
         }
 
         // for both files and folders
-        FilesDownloadWorker.FileDownloaderBinder downloaderBinder = fileActivity.getFileDownloaderBinder();
+        FileDownloadWorker.FileDownloaderBinder downloaderBinder = fileActivity.getFileDownloaderBinder();
         if (downloaderBinder != null && downloaderBinder.isDownloading(currentUser, file)) {
             downloaderBinder.cancelPendingOrCurrentDownloads(currentUser.toPlatformAccount(), file);
         }

+ 11 - 11
app/src/main/java/com/owncloud/android/ui/preview/PreviewImageActivity.java

@@ -37,8 +37,8 @@ import android.view.View;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.di.Injectable;
 import com.nextcloud.client.editimage.EditImageActivity;
-import com.nextcloud.client.files.downloader.FilesDownloadHelper;
-import com.nextcloud.client.files.downloader.FilesDownloadWorker;
+import com.nextcloud.client.files.downloader.FileDownloadHelper;
+import com.nextcloud.client.files.downloader.FileDownloadWorker;
 import com.nextcloud.client.preferences.AppPreferences;
 import com.nextcloud.java.util.Optional;
 import com.nextcloud.utils.extensions.IntentExtensionsKt;
@@ -311,8 +311,8 @@ public class PreviewImageActivity extends FileActivity implements
         public void onServiceConnected(ComponentName component, IBinder service) {
 
             if (component.equals(new ComponentName(PreviewImageActivity.this,
-                    FilesDownloadWorker.class))) {
-                mDownloaderBinder = (FilesDownloadWorker.FileDownloaderBinder) service;
+                                                   FileDownloadWorker.class))) {
+                mDownloaderBinder = (FileDownloadWorker.FileDownloaderBinder) service;
                 if (mRequestWaitingForBinder) {
                     mRequestWaitingForBinder = false;
                     Log_OC.d(TAG, "Simulating reselection of current page after connection " +
@@ -331,7 +331,7 @@ public class PreviewImageActivity extends FileActivity implements
         @Override
         public void onServiceDisconnected(ComponentName component) {
             if (component.equals(new ComponentName(PreviewImageActivity.this,
-                    FilesDownloadWorker.class))) {
+                                                   FileDownloadWorker.class))) {
                 Log_OC.d(TAG, "Download service suddenly disconnected");
                 mDownloaderBinder = null;
             } else if (component.equals(new ComponentName(PreviewImageActivity.this,
@@ -359,7 +359,7 @@ public class PreviewImageActivity extends FileActivity implements
         super.onResume();
 
         mDownloadFinishReceiver = new DownloadFinishReceiver();
-        IntentFilter downloadIntentFilter = new IntentFilter(FilesDownloadWorker.Companion.getDownloadFinishMessage());
+        IntentFilter downloadIntentFilter = new IntentFilter(FileDownloadWorker.Companion.getDownloadFinishMessage());
         localBroadcastManager.registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);
 
         mUploadFinishReceiver = new UploadFinishReceiver();
@@ -413,7 +413,7 @@ public class PreviewImageActivity extends FileActivity implements
 
         } else if (!mDownloaderBinder.isDownloading(getUserAccountManager().getUser(), file)) {
             final User user = getUser().orElseThrow(RuntimeException::new);
-            new FilesDownloadHelper().downloadFile(user, file, downloadBehaviour);
+            new FileDownloadHelper().downloadFile(user, file, downloadBehaviour);
         }
     }
 
@@ -478,7 +478,7 @@ public class PreviewImageActivity extends FileActivity implements
     }
 
     /**
-     * Class waiting for broadcast events from the {@link FilesDownloadWorker} service.
+     * Class waiting for broadcast events from the {@link FileDownloadWorker} service.
      *
      * Updates the UI when a download is started or finished, provided that it is relevant for the
      * folder displayed in the gallery.
@@ -498,12 +498,12 @@ public class PreviewImageActivity extends FileActivity implements
     }
 
     private void previewNewImage(Intent intent) {
-        String accountName = intent.getStringExtra(FilesDownloadWorker.ACCOUNT_NAME);
-        String downloadedRemotePath = intent.getStringExtra(FilesDownloadWorker.EXTRA_REMOTE_PATH);
+        String accountName = intent.getStringExtra(FileDownloadWorker.ACCOUNT_NAME);
+        String downloadedRemotePath = intent.getStringExtra(FileDownloadWorker.EXTRA_REMOTE_PATH);
         String downloadBehaviour = intent.getStringExtra(OCFileListFragment.DOWNLOAD_BEHAVIOUR);
         if (getAccount().name.equals(accountName) && downloadedRemotePath != null) {
             OCFile file = getStorageManager().getFileByPath(downloadedRemotePath);
-            boolean downloadWasFine = intent.getBooleanExtra(FilesDownloadWorker.EXTRA_DOWNLOAD_RESULT, false);
+            boolean downloadWasFine = intent.getBooleanExtra(FileDownloadWorker.EXTRA_DOWNLOAD_RESULT, false);
 
             if (EditImageActivity.OPEN_IMAGE_EDITOR.equals(downloadBehaviour)) {
                 startImageEditor(file);

+ 2 - 2
app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java

@@ -53,7 +53,7 @@ import android.view.ViewGroup;
 import com.nextcloud.client.account.User;
 import com.nextcloud.client.account.UserAccountManager;
 import com.nextcloud.client.di.Injectable;
-import com.nextcloud.client.files.downloader.FilesDownloadHelper;
+import com.nextcloud.client.files.downloader.FileDownloadHelper;
 import com.nextcloud.client.jobs.BackgroundJobManager;
 import com.nextcloud.client.media.ExoplayerListener;
 import com.nextcloud.client.media.NextcloudExoPlayer;
@@ -479,7 +479,7 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
                                                                     backgroundJobManager);
         } else if (itemId == R.id.action_download_file) {
             if (!containerActivity.getFileDownloaderBinder().isDownloading(user, getFile())) {
-                new FilesDownloadHelper().downloadFile(user, getFile());
+                new FileDownloadHelper().downloadFile(user, getFile());
             }
         }
     }

+ 5 - 5
app/src/main/java/third_parties/sufficientlysecure/SaveCalendar.java

@@ -42,11 +42,11 @@ import android.view.WindowManager;
 import android.widget.EditText;
 
 import com.nextcloud.client.account.User;
-import com.nextcloud.client.files.downloader.PostUploadAction;
-import com.nextcloud.client.files.downloader.Request;
-import com.nextcloud.client.files.downloader.TransferManagerConnection;
-import com.nextcloud.client.files.downloader.UploadRequest;
-import com.nextcloud.client.files.downloader.UploadTrigger;
+import com.nextcloud.client.files.Request;
+import com.nextcloud.client.files.UploadRequest;
+import com.nextcloud.client.files.transfer.TransferManagerConnection;
+import com.nextcloud.client.files.upload.PostUploadAction;
+import com.nextcloud.client.files.upload.UploadTrigger;
 import com.nextcloud.client.preferences.AppPreferences;
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.OCFile;