-
public abstract class FileCallback extends BaseFileCallback<FileCallback.ErrorCode, FileCallback.Report, Any>
Created on 17/08/20
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFileCallback.FileConflictActionpublic enumFileCallback.ConflictResolutionpublic enumFileCallback.ErrorCodepublic final classFileCallback.ReportOnly called if the returned onStart greater than
0
-
Field Summary
Fields Modifier and Type Field Description private CoroutineScopeuiScope
-
Constructor Summary
Constructors Constructor Description FileCallback(CoroutineScope uiScope)FileCallback()
-
Method Summary
Modifier and Type Method Description final CoroutineScopegetUiScope()final UnitsetUiScope(CoroutineScope uiScope)LongonStart(Object file, Thread workerThread)UnitonConflict(DocumentFile destinationFile, FileCallback.FileConflictAction action)Do not call superwhen you override this function.UnitonCompleted(Object result)-
-
Method Detail
-
getUiScope
final CoroutineScope getUiScope()
-
setUiScope
final Unit setUiScope(CoroutineScope uiScope)
-
onStart
@UiThread() Long onStart(Object file, Thread workerThread)
- Parameters:
file- can be DocumentFile or MediaFile
-
onConflict
@UiThread() Unit onConflict(DocumentFile destinationFile, FileCallback.FileConflictAction 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.
-
onCompleted
@UiThread() Unit onCompleted(Object result)
- Parameters:
result- can be DocumentFile or MediaFile
-
-
-
-