Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#constants) \| [Inherited Constants](https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#inhconstants) \| [Fields](https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#lfields) \| [Methods](https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#inhmethods)

# FileOperationResult

*** ** * ** ***

` public final class FileOperationResult `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.storage.operations.FileOperationResult |

<br />

*** ** * ** ***

Represents the result of a file operation.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_BUSY` The system is too busy to handle the request. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_DISK_FULL` The operation failed because the disk is full. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_INVALID_REQUEST` The system cannot fulfill the request as configured. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_NONE` Successful operation. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_PERMISSION_DENIED` The operation failed due to missing permissions. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_UNKNOWN` An unknown error. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_UNSUPPORTED_SOURCE` The source of the operation is unsupported or invalid. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_UNSUPPORTED_TARGET` The target of the operation is unsupported or invalid. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_FAILED` The operation failed. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_FINISHED` The operation finished successfully. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_IN_PROGRESS` The operation is currently running. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_QUEUED` The operation is queued and waiting to start. |
| `int` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_UNKNOWN` Unknown status. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/os/storage/operations/FileOperationResult>` | `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#getErrorCode()() ` Returns the error code if the operation failed. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#getErrorMessage()() ` Returns the error message if the operation failed. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#getFailedPaths()() ` Returns the list of failures. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#getRequestId()() ` Returns the unique ID of the request. |
| ` https://developer.android.com/reference/android/os/storage/operations/sources/OperationSource` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#getSource()() ` Returns the `https://developer.android.com/reference/android/os/storage/operations/sources/OperationSource` that was configured in the original `https://developer.android.com/reference/android/os/storage/operations/FileOperationRequest`. |
| ` int` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#getStatus()() ` Returns the current status of the operation. |
| ` https://developer.android.com/reference/android/os/storage/operations/targets/OperationTarget` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#getTarget()() ` Returns the target of the file operation. |
| ` void` | ` https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### ERROR_BUSY

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_BUSY
```

The system is too busy to handle the request.

This error is **transient**. Applications should consider retrying the operation after a short delay, potentially using an exponential backoff strategy.

<br />

Constant Value: 1 (0x00000001)

### ERROR_DISK_FULL

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_DISK_FULL
```

The operation failed because the disk is full.

This error is **potentially transient** if the user clears enough space on the storage device.

<br />

Constant Value: 6 (0x00000006)

### ERROR_INVALID_REQUEST

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INVALID_REQUEST
```

The system cannot fulfill the request as configured.

This error is **permanent** as it indicates a malformed or invalid request.

<br />

Constant Value: 2 (0x00000002)

### ERROR_NONE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_NONE
```

Successful operation.

<br />

Constant Value: -1 (0xffffffff)

### ERROR_PERMISSION_DENIED

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_PERMISSION_DENIED
```

The operation failed due to missing permissions.

This error is **permanent** unless the user manually grants the required permissions.

<br />

Constant Value: 5 (0x00000005)

### ERROR_UNKNOWN

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_UNKNOWN
```

An unknown error.

<br />

Constant Value: 0 (0x00000000)

### ERROR_UNSUPPORTED_SOURCE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_UNSUPPORTED_SOURCE
```

The source of the operation is unsupported or invalid.

This error is **permanent** as it indicates an issue with the request.

<br />

Constant Value: 3 (0x00000003)

### ERROR_UNSUPPORTED_TARGET

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_UNSUPPORTED_TARGET
```

The target of the operation is unsupported or invalid.

This error is **permanent** as it indicates an issue with the request.

<br />

Constant Value: 4 (0x00000004)

### STATUS_FAILED

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_FAILED
```

The operation failed.

<br />

Constant Value: 4 (0x00000004)

### STATUS_FINISHED

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_FINISHED
```

The operation finished successfully.

<br />

Constant Value: 3 (0x00000003)

### STATUS_IN_PROGRESS

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_IN_PROGRESS
```

The operation is currently running.

<br />

Constant Value: 2 (0x00000002)

### STATUS_QUEUED

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_QUEUED
```

The operation is queued and waiting to start.

<br />

Constant Value: 1 (0x00000001)

### STATUS_UNKNOWN

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_UNKNOWN
```

Unknown status.

<br />

Constant Value: 0 (0x00000000)

## Fields

### CREATOR

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<FileOperationResult> CREATOR
```

<br />

<br />

## Public methods

### describeContents

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getErrorCode

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getErrorCode ()
```

Returns the error code if the operation failed.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_NONE` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_UNKNOWN` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_BUSY` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_INVALID_REQUEST` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_UNSUPPORTED_SOURCE` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_UNSUPPORTED_TARGET` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_PERMISSION_DENIED` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#ERROR_DISK_FULL` |

### getErrorMessage

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getErrorMessage ()
```

Returns the error message if the operation failed.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value may be `null`. <br /> |

### getFailedPaths

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<String> getFailedPaths ()
```

Returns the list of failures.

This list is only populated when the operation reaches a terminal state (`https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_FINISHED` or `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_FAILED`).

Note: Due to binder transaction limits, this list can truncate the total number of reported failures. If failures occurred, only the first `https://developer.android.com/reference/android/os/storage/FileManager#getMaxReportedFailures()` are reported.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | This value cannot be `null`. <br /> |

### getRequestId

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getRequestId ()
```

Returns the unique ID of the request.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### getSource

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public OperationSource getSource ()
```

Returns the `https://developer.android.com/reference/android/os/storage/operations/sources/OperationSource` that was configured in the original `https://developer.android.com/reference/android/os/storage/operations/FileOperationRequest`.

For example, if an operation was created using a `https://developer.android.com/` that object would be returned here.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/storage/operations/sources/OperationSource` | This value cannot be `null`. <br /> |

### getStatus

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getStatus ()
```

Returns the current status of the operation.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_UNKNOWN` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_QUEUED` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_IN_PROGRESS` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_FINISHED` - `https://developer.android.com/reference/android/os/storage/operations/FileOperationResult#STATUS_FAILED` |

### getTarget

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public OperationTarget getTarget ()
```

Returns the target of the file operation.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/storage/operations/targets/OperationTarget` | This value may be `null`. <br /> |

### writeToParcel

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |