Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
//
// assertTrue(
// UploadFileOperation(
// uploadsStorageManager,
// uploadsStorageManager!!,
// connectivityServiceMock,
// powerManagementServiceMock,
// user,
Expand All @@ -97,7 +97,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
//
// assertTrue(
// UploadFileOperation(
// uploadsStorageManager,
// uploadsStorageManager!!,
// connectivityServiceMock,
// powerManagementServiceMock,
// user,
Expand Down Expand Up @@ -175,7 +175,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {

assertTrue(
UploadFileOperation(
uploadsStorageManager,
uploadsStorageManager!!,
connectivityServiceMock,
powerManagementServiceMock,
user,
Expand Down Expand Up @@ -203,7 +203,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {

assertTrue(
UploadFileOperation(
uploadsStorageManager,
uploadsStorageManager!!,
connectivityServiceMock,
powerManagementServiceMock,
user,
Expand All @@ -215,10 +215,11 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
false,
false,
storageManager
)
.addRenameUploadListener {
).addRenameUploadListener(object : UploadFileOperation.OnRenameListener {
override fun onRenameUpload() {
renameListenerWasTriggered = true
}
})
.execute(client)
.isSuccess
)
Expand Down Expand Up @@ -294,7 +295,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {

assertTrue(
UploadFileOperation(
uploadsStorageManager,
uploadsStorageManager!!,
connectivityServiceMock,
powerManagementServiceMock,
user,
Expand All @@ -321,7 +322,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {

assertFalse(
UploadFileOperation(
uploadsStorageManager,
uploadsStorageManager!!,
connectivityServiceMock,
powerManagementServiceMock,
user,
Expand Down Expand Up @@ -397,7 +398,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {

assertTrue(
UploadFileOperation(
uploadsStorageManager,
uploadsStorageManager!!,
connectivityServiceMock,
powerManagementServiceMock,
user,
Expand All @@ -423,7 +424,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
val ocUpload2 = OCUpload(getDummyFile("empty.txt").absolutePath, "/testFile.txt", account.name)

val uploadResult = UploadFileOperation(
uploadsStorageManager,
uploadsStorageManager!!,
connectivityServiceMock,
powerManagementServiceMock,
user,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import kotlinx.coroutines.withContext
import java.io.File
import java.util.concurrent.ConcurrentHashMap
import kotlin.random.Random
import kotlin.time.Duration.Companion.milliseconds

@Suppress("LongParameterList", "TooGenericExceptionCaught")
class FileUploadWorker(
Expand Down Expand Up @@ -250,7 +251,7 @@ class FileUploadWorker(
for ((index, upload) in uploads.withIndex()) {
ensureActive()

delay(retryPolicy.getDelay())
delay(retryPolicy.getDelay().milliseconds)

if (!skipAutoUploadCheck && isBelongToAnySyncedFolder(upload, syncFolderHelper, syncedFolders)) {
Log_OC.d(TAG, "skipping upload, will be handled by AutoUploadWorker: ${upload.localPath}")
Expand Down Expand Up @@ -368,7 +369,7 @@ class FileUploadWorker(
result = operation.execute(client)
val task = ThumbnailsCacheManager.ThumbnailGenerationTask(storageManager, user)
val file = File(operation.originalStoragePath)
val remoteId: String? = operation.file.remoteId
val remoteId: String? = operation.file!!.remoteId
task.execute(ThumbnailsCacheManager.ThumbnailGenerationTaskObject(file, remoteId))
fileUploadEventBroadcaster.sendUploadStarted(operation, context)
} catch (e: Exception) {
Expand All @@ -387,7 +388,7 @@ class FileUploadWorker(
val showSameFileAlreadyExistsNotification =
inputData.getBoolean(SHOW_SAME_FILE_ALREADY_EXISTS_NOTIFICATION, false)
if (showSameFileAlreadyExistsNotification) {
notificationManager.showSameFileAlreadyExistsNotification(operation.fileName)
notificationManager.showSameFileAlreadyExistsNotification(operation.fileName!!)
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class UploadNotificationManager(private val context: Context, viewThemeUtils: Vi
setProgress(0, 0, false)
}.build()

showNotification(operation.file.fileId.toInt(), notification)
showNotification(operation.file!!.fileId.toInt(), notification)
}

fun showConnectionErrorNotification() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object UploadErrorNotificationManager {
) {
Log_OC.d(TAG, "handle upload result with result code: " + result.code)

if (result.isSuccess || operation.isMissingPermissionThrown) {
if (result.isSuccess || operation.isMissingPermissionThrown()) {
Log_OC.d(TAG, "operation is successful, cancelled or lack of storage permission, notification skipped")
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
if (file.isFolder()) {
targetPath = targetParentPath + file.getFileName();
}
targetPath = UploadFileOperation.getNewAvailableRemotePath(client, targetPath, null, false);
targetPath = UploadFileOperation.Companion.getNewAvailableRemotePath(client, targetPath, null, false);

if (file.isFolder()) {
targetPath += OCFile.PATH_SEPARATOR;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2019 Andy Scherzinger <info@andy-scherzinger.de>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.operations

class UploadException : Exception {

constructor(message: String?) : super(message)

companion object {
private const val serialVersionUID = 5931153844211429915L
}
}
Loading
Loading