-
public abstract class MultipleFileCallback extends BaseFileCallback<MultipleFileCallback.ErrorCode, MultipleFileCallback.Report, MultipleFileCallback.Result>
Created on 31/05/21
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMultipleFileCallback.InvalidSourceFilesActionpublic final classMultipleFileCallback.ParentFolderConflictActionpublic final classMultipleFileCallback.ParentConflictpublic enumMultipleFileCallback.ErrorCodepublic final classMultipleFileCallback.ReportOnly called if the returned onStart greater than
0public final classMultipleFileCallback.ResultIf
totalCopiedFilesare less thantotalFilesToCopy, then some files cannot be copied/moved or the files are skipped due to ConflictResolution.MERGE can be called before BaseFileCallback.onCompleted when an error has occurred.
-
Field Summary
Fields Modifier and Type Field Description private CoroutineScopeuiScope
-
Constructor Summary
Constructors Constructor Description MultipleFileCallback(CoroutineScope uiScope)MultipleFileCallback()
-
Method Summary
Modifier and Type Method Description final CoroutineScopegetUiScope()final UnitsetUiScope(CoroutineScope uiScope)UnitonInvalidSourceFilesFound(Map<DocumentFile, FolderCallback.ErrorCode> invalidSourceFiles, MultipleFileCallback.InvalidSourceFilesAction action)The reason can be one of: UnitonCountingFiles()LongonStart(List<DocumentFile> files, Integer totalFilesToCopy, Thread workerThread)UnitonParentConflict(DocumentFile destinationParentFolder, List<MultipleFileCallback.ParentConflict> conflictedFolders, List<MultipleFileCallback.ParentConflict> conflictedFiles, MultipleFileCallback.ParentFolderConflictAction action)Do not call superwhen you override this function.UnitonContentConflict(DocumentFile destinationParentFolder, List<FolderCallback.FileConflict> conflictedFiles, FolderCallback.FolderContentConflictAction action)-
Methods inherited from class com.anggrayudi.storage.callback.MultipleFileCallback
onCheckFreeSpace, onCompleted, onDeleteConflictedFiles, onFailed, onPrepare, onReport, onValidate -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getUiScope
final CoroutineScope getUiScope()
-
setUiScope
final Unit setUiScope(CoroutineScope uiScope)
-
onInvalidSourceFilesFound
@UiThread() Unit onInvalidSourceFilesFound(Map<DocumentFile, FolderCallback.ErrorCode> invalidSourceFiles, MultipleFileCallback.InvalidSourceFilesAction action)
-
onCountingFiles
@UiThread() Unit onCountingFiles()
-
onStart
@UiThread() Long onStart(List<DocumentFile> files, Integer totalFilesToCopy, Thread workerThread)
- Parameters:
files- directories/files to be copied/moved
-
onParentConflict
@UiThread() Unit onParentConflict(DocumentFile destinationParentFolder, List<MultipleFileCallback.ParentConflict> conflictedFolders, List<MultipleFileCallback.ParentConflict> conflictedFiles, MultipleFileCallback.ParentFolderConflictAction action)
Do not call
superwhen you override this function.The thread that does copy/move will be suspended until the user gives an answer via FileConflictAction.confirmResolution. You have to give an answer, or the thread will be alive until the app is killed and end up as a zombie thread. If you want to cancel, just pass ConflictResolution.SKIP into FileConflictAction.confirmResolution. If the worker thread is suspended for too long, it may be interrupted by the system.
-
onContentConflict
@UiThread() Unit onContentConflict(DocumentFile destinationParentFolder, List<FolderCallback.FileConflict> conflictedFiles, FolderCallback.FolderContentConflictAction action)
-
-
-
-