UploadTask

public class UploadTask extends StorageTask


An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.

Summary

Nested types

Encapsulates state about the running UploadTask

Protected methods

void
void

Inherited methods

From com.google.firebase.storage.CancellableTask
abstract @NonNull CancellableTask<StateT>

Adds a listener that is called periodically while the ControllableTask executes.

abstract @NonNull CancellableTask<StateT>
addOnProgressListener(
    @NonNull Activity activity,
    @NonNull OnProgressListener<Object> listener
)

Adds a listener that is called periodically while the ControllableTask executes.

abstract @NonNull CancellableTask<StateT>
addOnProgressListener(
    @NonNull Executor executor,
    @NonNull OnProgressListener<Object> listener
)

Adds a listener that is called periodically while the ControllableTask executes.

From com.google.firebase.storage.ControllableTask
abstract @NonNull ControllableTask<StateT>

Adds a listener that is called when the Task becomes paused.

abstract @NonNull ControllableTask<StateT>
addOnPausedListener(
    @NonNull Activity activity,
    @NonNull OnPausedListener<Object> listener
)

Adds a listener that is called when the Task becomes paused.

abstract @NonNull ControllableTask<StateT>
addOnPausedListener(
    @NonNull Executor executor,
    @NonNull OnPausedListener<Object> listener
)

Adds a listener that is called when the Task becomes paused.

From com.google.firebase.storage.StorageTask
@NonNull StorageTask<ResultT>

Adds a listener that is called if the Task is canceled.

@NonNull StorageTask<ResultT>
addOnCanceledListener(
    @NonNull Activity activity,
    @NonNull OnCanceledListener listener
)

Adds an Activity-scoped listener that is called if the Task is canceled.

@NonNull StorageTask<ResultT>
addOnCanceledListener(
    @NonNull Executor executor,
    @NonNull OnCanceledListener listener
)

Adds a listener that is called if the Task is canceled.

@NonNull StorageTask<ResultT>

Adds a listener that is called when the Task succeeds or fails.

@NonNull StorageTask<ResultT>
addOnCompleteListener(
    @NonNull Activity activity,
    @NonNull OnCompleteListener<ResultT> listener
)

Adds a listener that is called when the Task succeeds or fails.

@NonNull StorageTask<ResultT>
addOnCompleteListener(
    @NonNull Executor executor,
    @NonNull OnCompleteListener<ResultT> listener
)

Adds a listener that is called when the Task succeeds or fails.

@NonNull StorageTask<ResultT>

Adds a listener that is called if the Task fails.

@NonNull StorageTask<ResultT>
addOnFailureListener(
    @NonNull Activity activity,
    @NonNull OnFailureListener listener
)

Adds a listener that is called if the Task fails.

@NonNull StorageTask<ResultT>
addOnFailureListener(
    @NonNull Executor executor,
    @NonNull OnFailureListener listener
)

Adds a listener that is called if the Task fails.

@NonNull StorageTask<ResultT>

Adds a listener that is called when the Task becomes paused.

@NonNull StorageTask<ResultT>
addOnPausedListener(
    @NonNull Activity activity,
    @NonNull OnPausedListener<Object> listener
)

Adds a listener that is called when the Task becomes paused.

@NonNull StorageTask<ResultT>
addOnPausedListener(
    @NonNull Executor executor,
    @NonNull OnPausedListener<Object> listener
)

Adds a listener that is called when the Task becomes paused.

@NonNull StorageTask<ResultT>

Adds a listener that is called periodically while the ControllableTask executes.

@NonNull StorageTask<ResultT>
addOnProgressListener(
    @NonNull Activity activity,
    @NonNull OnProgressListener<Object> listener
)

Adds a listener that is called periodically while the ControllableTask executes.

@NonNull StorageTask<ResultT>
addOnProgressListener(
    @NonNull Executor executor,
    @NonNull OnProgressListener<Object> listener
)

Adds a listener that is called periodically while the ControllableTask executes.

@NonNull StorageTask<ResultT>

Adds a listener that is called if the Task completes successfully.

@NonNull StorageTask<ResultT>
addOnSuccessListener(
    @NonNull Activity activity,
    @NonNull OnSuccessListener<Object> listener
)

Adds a listener that is called if the Task completes successfully.

@NonNull StorageTask<ResultT>
addOnSuccessListener(
    @NonNull Executor executor,
    @NonNull OnSuccessListener<Object> listener
)

Adds a listener that is called if the Task completes successfully.

boolean

Attempts to cancel the task.

@NonNull Task<ContinuationResultT>
<ContinuationResultT> continueWith(
    @NonNull Continuation<ResultT, ContinuationResultT> continuation
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

@NonNull Task<ContinuationResultT>
<ContinuationResultT> continueWith(
    @NonNull Executor executor,
    @NonNull Continuation<ResultT, ContinuationResultT> continuation
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

@NonNull Task<ContinuationResultT>
<ContinuationResultT> continueWithTask(
    @NonNull Continuation<ResultT, Task<ContinuationResultT>> continuation
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

@NonNull Task<ContinuationResultT>
<ContinuationResultT> continueWithTask(
    @NonNull Executor executor,
    @NonNull Continuation<ResultT, Task<ContinuationResultT>> continuation
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

@Nullable Exception

Returns the exception that caused the Task to fail.

@NonNull ResultT

Gets the result of the Task, if it has already completed.

@NonNull ResultT
<X extends Throwable> getResult(@NonNull Class<X> exceptionType)

Gets the result of the Task, if it has already completed.

@NonNull ResultT

Returns the current state of the task.

boolean

Returns true if the task has been canceled.

boolean

Returns true if the Task is complete; false otherwise.

boolean

Returns true if the task is currently running.

boolean

Returns true if the task has been paused.

boolean

Returns true if the Task has completed successfully; false otherwise.

void
void
void
void
void
@NonNull Task<ContinuationResultT>
<ContinuationResultT> onSuccessTask(
    @NonNull SuccessContinuation<ResultT, ContinuationResultT> continuation
)

Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully.

@NonNull Task<ContinuationResultT>
<ContinuationResultT> onSuccessTask(
    @NonNull Executor executor,
    @NonNull SuccessContinuation<ResultT, ContinuationResultT> continuation
)

Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully.

boolean

Attempts to pause the task.

@NonNull StorageTask<ResultT>

Removes a listener.

@NonNull StorageTask<ResultT>

Removes a listener.

@NonNull StorageTask<ResultT>

Removes a listener.

@NonNull StorageTask<ResultT>

Removes a listener.

@NonNull StorageTask<ResultT>

Removes a listener.

@NonNull StorageTask<ResultT>

Removes a listener.

boolean

Attempts to resume a paused task.

From com.google.android.gms.tasks.Task
Task<TResult>
Task<TResult>
abstract Task<TResult>
abstract Task<TResult>
Task<TContinuationResult>
<TContinuationResult> continueWith(
    Continuation<TResult, TContinuationResult> p
)
Task<TContinuationResult>
<TContinuationResult> continueWithTask(
    Continuation<TResult, Task<TContinuationResult>> p
)
abstract Exception
abstract TResult
abstract boolean
abstract boolean
abstract boolean
Task<TContinuationResult>
<TContinuationResult> onSuccessTask(
    SuccessContinuation<TResult, TContinuationResult> p
)

Protected methods

onCanceled

protected void onCanceled()

resetState

protected void resetState()