Added in API level 37

FileOperationRequest


class FileOperationRequest : Parcelable
kotlin.Any
   ↳ android.os.storage.operations.FileOperationRequest

Encapsulates a request to Move, or Copy files.

Summary

Nested classes

Builder for constructing FileOperationRequest instances.

Constants
static Int

Operation mode indicating that files should be copied from the source to the target.

static Int

Operation mode indicating that files should be moved from the source to the target.

Inherited constants
Public methods
Int

implemented for Parcelable

Int

Returns the type of file operation to be performed for this request.

OperationSource

Returns the source of the file operation.

OperationTarget?

Returns the target of the file operation.

Boolean

Returns true if a completion listener should be automatically registered for this request.

Unit
writeToParcel(dest: Parcel, flags: Int)

implemented for Parcelable

Properties
static Parcelable.Creator<FileOperationRequest!>

Constants

OPERATION_COPY

Added in API level 37
static val OPERATION_COPY: Int

Operation mode indicating that files should be copied from the source to the target.

A copy operation creates duplicates of the files from the OperationSource at the destination specified by the OperationTarget, while the original files remain unchanged at the source.

Value: 2

OPERATION_MOVE

Added in API level 37
static val OPERATION_MOVE: Int

Operation mode indicating that files should be moved from the source to the target.

A move operation results in the files being transferred to the destination specified by the OperationTarget and subsequently removed from the OperationSource.

Note: While a move will be attempted, it is possible that this still results in standard Copy + Delete behavior, as the Source/Target may not be on the same underlying storage volume.

Value: 1

Public methods

describeContents

Added in API level 37
fun describeContents(): Int

implemented for Parcelable

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getMode

Added in API level 37
fun getMode(): Int

Returns the type of file operation to be performed for this request.

Return
Int The operation mode, which will be either OPERATION_MOVE or OPERATION_COPY.
Value is one of the following:

getSource

Added in API level 37
fun getSource(): OperationSource

Returns the source of the file operation.

Return
OperationSource This value cannot be null.

getTarget

Added in API level 37
fun getTarget(): OperationTarget?

Returns the target of the file operation.

Return
OperationTarget? This value may be null.

shouldRegisterCompletionListener

Added in API level 37
fun shouldRegisterCompletionListener(): Boolean

Returns true if a completion listener should be automatically registered for this request.

writeToParcel

Added in API level 37
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

implemented for Parcelable

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 37
static val CREATOR: Parcelable.Creator<FileOperationRequest!>