From 883c8deeb485875807be962554bbcaf2aace4c38 Mon Sep 17 00:00:00 2001 From: Anggrayudi Hardiannico Date: Sun, 30 Jun 2024 05:29:02 +0700 Subject: [PATCH] added missing throw --- .gitignore | 1 + .../storage/sample/activity/MainActivity.kt | 34 +++++---- .../com/anggrayudi/storage/SimpleStorage.kt | 7 ++ .../callback/MultipleFilesConflictCallback.kt | 6 +- ...ack.kt => SingleFolderConflictCallback.kt} | 2 +- .../storage/file/DocumentFileExt.kt | 69 ++++++++++--------- .../storage/result/MultipleFilesResult.kt | 2 +- .../storage/result/SingleFolderResult.kt | 6 +- 8 files changed, 72 insertions(+), 55 deletions(-) rename storage/src/main/java/com/anggrayudi/storage/callback/{FolderConflictCallback.kt => SingleFolderConflictCallback.kt} (97%) diff --git a/.gitignore b/.gitignore index 9904d9a..9a805dd 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ captures/ # IntelliJ *.iml .idea +.kotlin # Keystore files # Uncomment the following line if you do not want to check your keystore files in. diff --git a/sample/src/main/java/com/anggrayudi/storage/sample/activity/MainActivity.kt b/sample/src/main/java/com/anggrayudi/storage/sample/activity/MainActivity.kt index c4471ab..5811c75 100644 --- a/sample/src/main/java/com/anggrayudi/storage/sample/activity/MainActivity.kt +++ b/sample/src/main/java/com/anggrayudi/storage/sample/activity/MainActivity.kt @@ -23,9 +23,9 @@ import com.afollestad.materialdialogs.customview.getCustomView import com.afollestad.materialdialogs.input.input import com.afollestad.materialdialogs.list.listItems import com.anggrayudi.storage.SimpleStorageHelper -import com.anggrayudi.storage.callback.FolderConflictCallback import com.anggrayudi.storage.callback.MultipleFilesConflictCallback import com.anggrayudi.storage.callback.SingleFileConflictCallback +import com.anggrayudi.storage.callback.SingleFolderConflictCallback import com.anggrayudi.storage.extension.launchOnUiThread import com.anggrayudi.storage.file.baseName import com.anggrayudi.storage.file.changeName @@ -377,8 +377,8 @@ class MainActivity : AppCompatActivity() { override fun onContentConflict( destinationParentFolder: DocumentFile, - conflictedFiles: MutableList, - action: FolderConflictCallback.FolderContentConflictAction + conflictedFiles: MutableList, + action: SingleFolderConflictCallback.FolderContentConflictAction ) { handleFolderContentConflict(action, conflictedFiles) } @@ -480,7 +480,7 @@ class MainActivity : AppCompatActivity() { } } - private fun createFolderCallback() = object : FolderConflictCallback(uiScope) { + private fun createFolderCallback() = object : SingleFolderConflictCallback(uiScope) { override fun onParentConflict(destinationFolder: DocumentFile, action: ParentFolderConflictAction, canMerge: Boolean) { handleParentFolderConflict(destinationFolder, action, canMerge) } @@ -667,7 +667,7 @@ class MainActivity : AppCompatActivity() { .message(text = "Folder \"${currentSolution.target.name}\" already exists in destination. What's your action?") .checkBoxPrompt(text = "Apply to all") { doForAll = it } .listItems(items = mutableListOf("Replace", "Merge", "Create New", "Skip Duplicate").apply { if (!canMerge) remove("Merge") }) { _, index, _ -> - currentSolution.solution = FolderConflictCallback.ConflictResolution.entries[if (!canMerge && index > 0) index + 1 else index] + currentSolution.solution = SingleFolderConflictCallback.ConflictResolution.entries[if (!canMerge && index > 0) index + 1 else index] newSolution.add(currentSolution) if (doForAll) { conflictedFolders.forEach { it.solution = currentSolution.solution } @@ -698,7 +698,7 @@ class MainActivity : AppCompatActivity() { .message(text = "File \"${currentSolution.target.name}\" already exists in destination. What's your action?") .checkBoxPrompt(text = "Apply to all") { doForAll = it } .listItems(items = mutableListOf("Replace", "Create New", "Skip Duplicate")) { _, index, _ -> - currentSolution.solution = FolderConflictCallback.ConflictResolution.entries[if (index > 0) index + 1 else index] + currentSolution.solution = SingleFolderConflictCallback.ConflictResolution.entries[if (index > 0) index + 1 else index] newSolution.add(currentSolution) if (doForAll) { conflictedFiles.forEach { it.solution = currentSolution.solution } @@ -711,15 +711,19 @@ class MainActivity : AppCompatActivity() { .show() } - private fun handleParentFolderConflict(destinationFolder: DocumentFile, action: FolderConflictCallback.ParentFolderConflictAction, canMerge: Boolean) { + private fun handleParentFolderConflict( + destinationFolder: DocumentFile, + action: SingleFolderConflictCallback.ParentFolderConflictAction, + canMerge: Boolean + ) { MaterialDialog(this) .cancelable(false) .title(text = "Conflict Found") .message(text = "Folder \"${destinationFolder.name}\" already exists in destination. What's your action?") .listItems(items = mutableListOf("Replace", "Merge", "Create New", "Skip Duplicate").apply { if (!canMerge) remove("Merge") }) { _, index, _ -> - val resolution = FolderConflictCallback.ConflictResolution.entries[if (!canMerge && index > 0) index + 1 else index] + val resolution = SingleFolderConflictCallback.ConflictResolution.entries[if (!canMerge && index > 0) index + 1 else index] action.confirmResolution(resolution) - if (resolution == FolderConflictCallback.ConflictResolution.SKIP) { + if (resolution == SingleFolderConflictCallback.ConflictResolution.SKIP) { Toast.makeText(this, "Skipped duplicate folders & files", Toast.LENGTH_SHORT).show() } } @@ -727,17 +731,17 @@ class MainActivity : AppCompatActivity() { } private fun handleFolderContentConflict( - action: FolderConflictCallback.FolderContentConflictAction, - conflictedFiles: MutableList + action: SingleFolderConflictCallback.FolderContentConflictAction, + conflictedFiles: MutableList ) { - val newSolution = ArrayList(conflictedFiles.size) + val newSolution = ArrayList(conflictedFiles.size) askSolution(action, conflictedFiles, newSolution) } private fun askSolution( - action: FolderConflictCallback.FolderContentConflictAction, - conflictedFiles: MutableList, - newSolution: MutableList + action: SingleFolderConflictCallback.FolderContentConflictAction, + conflictedFiles: MutableList, + newSolution: MutableList ) { val currentSolution = conflictedFiles.removeFirstOrNull() if (currentSolution == null) { diff --git a/storage/src/main/java/com/anggrayudi/storage/SimpleStorage.kt b/storage/src/main/java/com/anggrayudi/storage/SimpleStorage.kt index 162934e..2b02d1c 100644 --- a/storage/src/main/java/com/anggrayudi/storage/SimpleStorage.kt +++ b/storage/src/main/java/com/anggrayudi/storage/SimpleStorage.kt @@ -535,6 +535,13 @@ class SimpleStorage private constructor(private val wrapper: ComponentWrapper) { if (requestCodeCreateFile == 0) { requestCodeCreateFile = DEFAULT_REQUEST_CODE_CREATE_FILE } + + if (setOf(requestCodeFilePicker, requestCodeFolderPicker, requestCodeStorageAccess, requestCodeCreateFile).size < 4) { + throw IllegalArgumentException( + "Request codes must be unique. File picker=$requestCodeFilePicker, Folder picker=$requestCodeFolderPicker, " + + "Storage access=$requestCodeStorageAccess, Create file=$requestCodeCreateFile" + ) + } } private fun saveUriPermission(root: Uri) = try { diff --git a/storage/src/main/java/com/anggrayudi/storage/callback/MultipleFilesConflictCallback.kt b/storage/src/main/java/com/anggrayudi/storage/callback/MultipleFilesConflictCallback.kt index a9a8109..e22ca67 100644 --- a/storage/src/main/java/com/anggrayudi/storage/callback/MultipleFilesConflictCallback.kt +++ b/storage/src/main/java/com/anggrayudi/storage/callback/MultipleFilesConflictCallback.kt @@ -2,8 +2,8 @@ package com.anggrayudi.storage.callback import androidx.annotation.UiThread import androidx.documentfile.provider.DocumentFile -import com.anggrayudi.storage.callback.FolderConflictCallback.ConflictResolution import com.anggrayudi.storage.callback.SingleFileConflictCallback.FileConflictAction +import com.anggrayudi.storage.callback.SingleFolderConflictCallback.ConflictResolution import com.anggrayudi.storage.result.FolderErrorCode import kotlinx.coroutines.CancellableContinuation import kotlinx.coroutines.CoroutineScope @@ -49,8 +49,8 @@ abstract class MultipleFilesConflictCallback @OptIn(DelicateCoroutinesApi::class @UiThread open fun onContentConflict( destinationParentFolder: DocumentFile, - conflictedFiles: MutableList, - action: FolderConflictCallback.FolderContentConflictAction + conflictedFiles: MutableList, + action: SingleFolderConflictCallback.FolderContentConflictAction ) { action.confirmResolution(conflictedFiles) } diff --git a/storage/src/main/java/com/anggrayudi/storage/callback/FolderConflictCallback.kt b/storage/src/main/java/com/anggrayudi/storage/callback/SingleFolderConflictCallback.kt similarity index 97% rename from storage/src/main/java/com/anggrayudi/storage/callback/FolderConflictCallback.kt rename to storage/src/main/java/com/anggrayudi/storage/callback/SingleFolderConflictCallback.kt index 12aa5a7..0531ce8 100644 --- a/storage/src/main/java/com/anggrayudi/storage/callback/FolderConflictCallback.kt +++ b/storage/src/main/java/com/anggrayudi/storage/callback/SingleFolderConflictCallback.kt @@ -14,7 +14,7 @@ import kotlinx.coroutines.GlobalScope * Created on 3/1/21 * @author Anggrayudi H */ -abstract class FolderConflictCallback @OptIn(DelicateCoroutinesApi::class) @JvmOverloads constructor( +abstract class SingleFolderConflictCallback @OptIn(DelicateCoroutinesApi::class) @JvmOverloads constructor( var uiScope: CoroutineScope = GlobalScope ) { diff --git a/storage/src/main/java/com/anggrayudi/storage/file/DocumentFileExt.kt b/storage/src/main/java/com/anggrayudi/storage/file/DocumentFileExt.kt index aea8154..ab616c5 100644 --- a/storage/src/main/java/com/anggrayudi/storage/file/DocumentFileExt.kt +++ b/storage/src/main/java/com/anggrayudi/storage/file/DocumentFileExt.kt @@ -18,9 +18,9 @@ import androidx.core.content.FileProvider import androidx.core.content.MimeTypeFilter import androidx.documentfile.provider.DocumentFile import com.anggrayudi.storage.SimpleStorage -import com.anggrayudi.storage.callback.FolderConflictCallback import com.anggrayudi.storage.callback.MultipleFilesConflictCallback import com.anggrayudi.storage.callback.SingleFileConflictCallback +import com.anggrayudi.storage.callback.SingleFolderConflictCallback import com.anggrayudi.storage.extension.awaitUiResultWithPending import com.anggrayudi.storage.extension.childOf import com.anggrayudi.storage.extension.closeEntryQuietly @@ -1528,7 +1528,7 @@ private fun List.copyTo( close() return@callbackFlow } - validSources.removeAll(conflictResolutions.filter { it.solution == FolderConflictCallback.ConflictResolution.SKIP }.map { it.source }) + validSources.removeAll(conflictResolutions.filter { it.solution == SingleFolderConflictCallback.ConflictResolution.SKIP }.map { it.source }) if (validSources.isEmpty()) { close() return@callbackFlow @@ -1536,10 +1536,15 @@ private fun List.copyTo( send(MultipleFilesResult.CountingFiles) - class SourceInfo(val children: List?, val size: Long, val totalFiles: Int, val conflictResolution: FolderConflictCallback.ConflictResolution) + class SourceInfo( + val children: List?, + val size: Long, + val totalFiles: Int, + val conflictResolution: SingleFolderConflictCallback.ConflictResolution + ) val sourceInfos = validSources.associateWith { src -> - val resolution = conflictResolutions.find { it.source == src }?.solution ?: FolderConflictCallback.ConflictResolution.CREATE_NEW + val resolution = conflictResolutions.find { it.source == src }?.solution ?: SingleFolderConflictCallback.ConflictResolution.CREATE_NEW if (src.isFile) { SourceInfo(null, src.length(), 1, resolution) } else { @@ -1689,7 +1694,7 @@ private fun List.copyTo( } } - val conflictedFiles = mutableListOf() + val conflictedFiles = mutableListOf() for ((src, info) in sourceInfos) { if (isClosedForSend) { @@ -1740,7 +1745,7 @@ private fun List.copyTo( targetFile = targetRootFile.makeFile(context, filename, sourceFile.type, CreateMode.REUSE) if (targetFile != null && targetFile.length() > 0) { - conflictedFiles.add(FolderConflictCallback.FileConflict(sourceFile, targetFile)) + conflictedFiles.add(SingleFolderConflictCallback.FileConflict(sourceFile, targetFile)) continue } @@ -1779,7 +1784,7 @@ private fun List.copyTo( } val solutions = awaitUiResultWithPending(onConflict.uiScope) { - onConflict.onContentConflict(writableTargetParentFolder, conflictedFiles, FolderConflictCallback.FolderContentConflictAction(it)) + onConflict.onContentConflict(writableTargetParentFolder, conflictedFiles, SingleFolderConflictCallback.FolderContentConflictAction(it)) }.filter { // free up space first, by deleting some files if (it.solution == SingleFileConflictCallback.ConflictResolution.SKIP) { @@ -1885,7 +1890,7 @@ private fun DocumentFile.tryMoveFolderByRenamingPath( targetFolderParentName: String, skipEmptyFiles: Boolean, newFolderNameInTargetPath: String?, - conflictResolution: FolderConflictCallback.ConflictResolution + conflictResolution: SingleFolderConflictCallback.ConflictResolution ): Any? { if (inSameMountPointWith(context, writableTargetParentFolder)) { if (inInternalStorage(context)) { @@ -1939,7 +1944,7 @@ fun DocumentFile.moveFolderTo( newFolderNameInTargetPath: String? = null, updateInterval: Long = 500, isFileSizeAllowed: CheckFileSize = defaultFileSizeChecker, - onConflict: FolderConflictCallback + onConflict: SingleFolderConflictCallback ): Flow { return copyFolderTo(context, targetParentFolder, skipEmptyFiles, newFolderNameInTargetPath, true, updateInterval, isFileSizeAllowed, onConflict) } @@ -1952,7 +1957,7 @@ fun DocumentFile.copyFolderTo( newFolderNameInTargetPath: String? = null, updateInterval: Long = 500, isFileSizeAllowed: CheckFileSize = defaultFileSizeChecker, - onConflict: FolderConflictCallback + onConflict: SingleFolderConflictCallback ): Flow { return copyFolderTo(context, targetParentFolder, skipEmptyFiles, newFolderNameInTargetPath, false, updateInterval, isFileSizeAllowed, onConflict) } @@ -1969,7 +1974,7 @@ private fun DocumentFile.copyFolderTo( deleteSourceWhenComplete: Boolean, updateInterval: Long = 500, isFileSizeAllowed: CheckFileSize = defaultFileSizeChecker, - onConflict: FolderConflictCallback + onConflict: SingleFolderConflictCallback ): Flow = callbackFlow { val writableTargetParentFolder = doesMeetFolderCopyRequirements(context, targetParentFolder, newFolderNameInTargetPath, this) if (writableTargetParentFolder == null) { @@ -1981,7 +1986,7 @@ private fun DocumentFile.copyFolderTo( val targetFolderParentName = (newFolderNameInTargetPath ?: name.orEmpty()).removeForbiddenCharsFromFilename().trimFileSeparator() val conflictResolution = handleParentFolderConflict(context, targetParentFolder, targetFolderParentName, this, onConflict) - if (conflictResolution == FolderConflictCallback.ConflictResolution.SKIP) { + if (conflictResolution == SingleFolderConflictCallback.ConflictResolution.SKIP) { close() return@callbackFlow } @@ -2070,7 +2075,7 @@ private fun DocumentFile.copyFolderTo( } } - val conflictedFiles = ArrayList(totalFilesToCopy) + val conflictedFiles = ArrayList(totalFilesToCopy) val buffer = ByteArray(DEFAULT_BUFFER_SIZE) var success = true @@ -2140,7 +2145,7 @@ private fun DocumentFile.copyFolderTo( targetFile = targetFolder.makeFile(context, filename, sourceFile.type, CreateMode.REUSE) if (targetFile != null && targetFile.length() > 0) { - conflictedFiles.add(FolderConflictCallback.FileConflict(sourceFile, targetFile)) + conflictedFiles.add(SingleFolderConflictCallback.FileConflict(sourceFile, targetFile)) continue } @@ -2175,7 +2180,7 @@ private fun DocumentFile.copyFolderTo( } val solutions = awaitUiResultWithPending(onConflict.uiScope) { - onConflict.onContentConflict(targetFolder, conflictedFiles, FolderConflictCallback.FolderContentConflictAction(it)) + onConflict.onContentConflict(targetFolder, conflictedFiles, SingleFolderConflictCallback.FolderContentConflictAction(it)) }.filter { // free up space first, by deleting some files if (it.solution == SingleFileConflictCallback.ConflictResolution.SKIP) { @@ -2847,20 +2852,20 @@ private fun handleParentFolderConflict( targetParentFolder: DocumentFile, targetFolderParentName: String, scope: ProducerScope, - onConflict: FolderConflictCallback -): FolderConflictCallback.ConflictResolution { + onConflict: SingleFolderConflictCallback +): SingleFolderConflictCallback.ConflictResolution { targetParentFolder.child(context, targetFolderParentName)?.let { targetFolder -> val canMerge = targetFolder.isDirectory if (canMerge && targetFolder.isEmpty(context)) { - return FolderConflictCallback.ConflictResolution.MERGE + return SingleFolderConflictCallback.ConflictResolution.MERGE } val resolution = awaitUiResultWithPending(onConflict.uiScope) { - onConflict.onParentConflict(targetFolder, FolderConflictCallback.ParentFolderConflictAction(it), canMerge) + onConflict.onParentConflict(targetFolder, SingleFolderConflictCallback.ParentFolderConflictAction(it), canMerge) } when (resolution) { - FolderConflictCallback.ConflictResolution.REPLACE -> { + SingleFolderConflictCallback.ConflictResolution.REPLACE -> { scope.trySend(SingleFolderResult.DeletingConflictedFiles) val isFolder = targetFolder.isDirectory if (targetFolder.forceDelete(context, true)) { @@ -2868,26 +2873,26 @@ private fun handleParentFolderConflict( val newFolder = targetFolder.parentFile?.createDirectory(targetFolderParentName) if (newFolder == null) { scope.trySend(SingleFolderResult.Error(FolderErrorCode.CANNOT_CREATE_FILE_IN_TARGET)) - return FolderConflictCallback.ConflictResolution.SKIP + return SingleFolderConflictCallback.ConflictResolution.SKIP } } } else { scope.trySend(SingleFolderResult.Error(FolderErrorCode.CANNOT_CREATE_FILE_IN_TARGET)) - return FolderConflictCallback.ConflictResolution.SKIP + return SingleFolderConflictCallback.ConflictResolution.SKIP } } - FolderConflictCallback.ConflictResolution.MERGE -> { + SingleFolderConflictCallback.ConflictResolution.MERGE -> { if (targetFolder.isFile) { if (targetFolder.delete()) { val newFolder = targetFolder.parentFile?.createDirectory(targetFolderParentName) if (newFolder == null) { scope.trySend(SingleFolderResult.Error(FolderErrorCode.CANNOT_CREATE_FILE_IN_TARGET)) - return FolderConflictCallback.ConflictResolution.SKIP + return SingleFolderConflictCallback.ConflictResolution.SKIP } } else { scope.trySend(SingleFolderResult.Error(FolderErrorCode.CANNOT_CREATE_FILE_IN_TARGET)) - return FolderConflictCallback.ConflictResolution.SKIP + return SingleFolderConflictCallback.ConflictResolution.SKIP } } } @@ -2898,7 +2903,7 @@ private fun handleParentFolderConflict( } return resolution } - return FolderConflictCallback.ConflictResolution.CREATE_NEW + return SingleFolderConflictCallback.ConflictResolution.CREATE_NEW } private fun List.handleParentFolderConflict( @@ -2913,29 +2918,29 @@ private fun List.handleParentFolderConflict( val sourceFile = first { src -> src.name == it.name } val canMerge = sourceFile.isDirectory && it.isDirectory val solution = - if (canMerge && it.isEmpty(context)) FolderConflictCallback.ConflictResolution.MERGE else FolderConflictCallback.ConflictResolution.CREATE_NEW + if (canMerge && it.isEmpty(context)) SingleFolderConflictCallback.ConflictResolution.MERGE else SingleFolderConflictCallback.ConflictResolution.CREATE_NEW MultipleFilesConflictCallback.ParentConflict(sourceFile, it, canMerge, solution) } - val unresolvedConflicts = conflicts.filter { it.solution != FolderConflictCallback.ConflictResolution.MERGE }.toMutableList() + val unresolvedConflicts = conflicts.filter { it.solution != SingleFolderConflictCallback.ConflictResolution.MERGE }.toMutableList() if (unresolvedConflicts.isNotEmpty()) { val unresolvedFiles = unresolvedConflicts.filter { it.source.isFile }.toMutableList() val unresolvedFolders = unresolvedConflicts.filter { it.source.isDirectory }.toMutableList() val resolution = awaitUiResultWithPending(onConflict.uiScope) { onConflict.onParentConflict(targetParentFolder, unresolvedFolders, unresolvedFiles, MultipleFilesConflictCallback.ParentFolderConflictAction(it)) } - if (resolution.any { it.solution == FolderConflictCallback.ConflictResolution.REPLACE }) { + if (resolution.any { it.solution == SingleFolderConflictCallback.ConflictResolution.REPLACE }) { scope.trySend(MultipleFilesResult.DeletingConflictedFiles) } resolution.forEach { conflict -> when (conflict.solution) { - FolderConflictCallback.ConflictResolution.REPLACE -> { + SingleFolderConflictCallback.ConflictResolution.REPLACE -> { if (!conflict.target.let { it.forceDelete(context, true) || !it.exists() }) { scope.trySend(MultipleFilesResult.Error(MultipleFilesErrorCode.CANNOT_CREATE_FILE_IN_TARGET)) return null } } - FolderConflictCallback.ConflictResolution.MERGE -> { + SingleFolderConflictCallback.ConflictResolution.MERGE -> { if (conflict.target.isFile && !conflict.target.delete()) { scope.trySend(MultipleFilesResult.Error(MultipleFilesErrorCode.CANNOT_CREATE_FILE_IN_TARGET)) return null @@ -2947,7 +2952,7 @@ private fun List.handleParentFolderConflict( } } } - return resolution.toMutableList().apply { addAll(conflicts.filter { it.solution == FolderConflictCallback.ConflictResolution.MERGE }) } + return resolution.toMutableList().apply { addAll(conflicts.filter { it.solution == SingleFolderConflictCallback.ConflictResolution.MERGE }) } } return emptyList() } \ No newline at end of file diff --git a/storage/src/main/java/com/anggrayudi/storage/result/MultipleFilesResult.kt b/storage/src/main/java/com/anggrayudi/storage/result/MultipleFilesResult.kt index 68441f8..b73f72a 100644 --- a/storage/src/main/java/com/anggrayudi/storage/result/MultipleFilesResult.kt +++ b/storage/src/main/java/com/anggrayudi/storage/result/MultipleFilesResult.kt @@ -1,7 +1,7 @@ package com.anggrayudi.storage.result import androidx.documentfile.provider.DocumentFile -import com.anggrayudi.storage.callback.FolderConflictCallback.ConflictResolution +import com.anggrayudi.storage.callback.SingleFolderConflictCallback.ConflictResolution /** * Created on 7/6/24 diff --git a/storage/src/main/java/com/anggrayudi/storage/result/SingleFolderResult.kt b/storage/src/main/java/com/anggrayudi/storage/result/SingleFolderResult.kt index 7940b97..00b2da8 100644 --- a/storage/src/main/java/com/anggrayudi/storage/result/SingleFolderResult.kt +++ b/storage/src/main/java/com/anggrayudi/storage/result/SingleFolderResult.kt @@ -1,9 +1,9 @@ package com.anggrayudi.storage.result import androidx.documentfile.provider.DocumentFile -import com.anggrayudi.storage.callback.FolderConflictCallback -import com.anggrayudi.storage.callback.FolderConflictCallback.ConflictResolution import com.anggrayudi.storage.callback.SingleFileConflictCallback +import com.anggrayudi.storage.callback.SingleFolderConflictCallback +import com.anggrayudi.storage.callback.SingleFolderConflictCallback.ConflictResolution /** * Created on 7/6/24 @@ -15,7 +15,7 @@ sealed class SingleFolderResult { data object CountingFiles : SingleFolderResult() /** - * Called after the user chooses [FolderConflictCallback.ConflictResolution.REPLACE] or [SingleFileConflictCallback.ConflictResolution.REPLACE] + * Called after the user chooses [SingleFolderConflictCallback.ConflictResolution.REPLACE] or [SingleFileConflictCallback.ConflictResolution.REPLACE] */ data object DeletingConflictedFiles : SingleFolderResult() data class Starting(val files: List, val totalFilesToCopy: Int) : SingleFolderResult()