FileDownloadTask

public classFileDownloadTask extendsStorageTask


A task that downloads bytes of a GCS blob to a specified File.

Summary

Nested types

Encapsulates state about the runningFileDownloadTask

Protected methods

void

Inherited methods

Fromcom.google.firebase.storage.CancellableTask
abstract @NonNullCancellableTask<StateT>

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

abstract @NonNullCancellableTask<StateT>

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

abstract @NonNullCancellableTask<StateT>

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

Fromcom.google.firebase.storage.ControllableTask
abstract @NonNullControllableTask<StateT>

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

abstract @NonNullControllableTask<StateT>
addOnPausedListener(
    @NonNullActivity activity,
    @NonNullOnPausedListener<Object> listener
)

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

abstract @NonNullControllableTask<StateT>
addOnPausedListener(
    @NonNullExecutor executor,
    @NonNullOnPausedListener<Object> listener
)

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

Fromcom.google.firebase.storage.StorageTask
@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>
addOnCanceledListener(
    @NonNullActivity activity,
    @NonNullOnCanceledListener listener
)

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

@NonNullStorageTask<ResultT>
addOnCanceledListener(
    @NonNullExecutor executor,
    @NonNullOnCanceledListener listener
)

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

@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>
addOnCompleteListener(
    @NonNullActivity activity,
    @NonNullOnCompleteListener<ResultT> listener
)

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

@NonNullStorageTask<ResultT>
addOnCompleteListener(
    @NonNullExecutor executor,
    @NonNullOnCompleteListener<ResultT> listener
)

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

@NonNullStorageTask<ResultT>

Adds a listener that is called if the Task fails.

@NonNullStorageTask<ResultT>
addOnFailureListener(
    @NonNullActivity activity,
    @NonNullOnFailureListener listener
)

Adds a listener that is called if the Task fails.

@NonNullStorageTask<ResultT>
addOnFailureListener(
    @NonNullExecutor executor,
    @NonNullOnFailureListener listener
)

Adds a listener that is called if the Task fails.

@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>
addOnPausedListener(
    @NonNullActivity activity,
    @NonNullOnPausedListener<Object> listener
)

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

@NonNullStorageTask<ResultT>
addOnPausedListener(
    @NonNullExecutor executor,
    @NonNullOnPausedListener<Object> listener
)

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

@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>

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

@NonNullStorageTask<ResultT>

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

boolean

Attempts to cancel the task.

@NonNullTask<ContinuationResultT>
<ContinuationResultT>continueWith(
    @NonNullContinuation<ResultT, ContinuationResultT> continuation
)

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

@NonNullTask<ContinuationResultT>
<ContinuationResultT>continueWith(
    @NonNullExecutor executor,
    @NonNullContinuation<ResultT, ContinuationResultT> continuation
)

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

@NonNullTask<ContinuationResultT>
<ContinuationResultT>continueWithTask(
    @NonNullContinuation<ResultT, Task<ContinuationResultT>> continuation
)

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

@NonNullTask<ContinuationResultT>
<ContinuationResultT>continueWithTask(
    @NonNullExecutor executor,
    @NonNullContinuation<ResultT, Task<ContinuationResultT>> continuation
)

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

@NullableException

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(@NonNullClass<X> exceptionType)

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

@NonNull ResultT

Returns the current state of the task.

boolean

Returnstrue if the task has been canceled.

boolean

Returnstrue if the Task is complete;false otherwise.

boolean

Returnstrue if the task is currently running.

boolean

Returnstrue if the task has been paused.

boolean

Returnstrue if the Task has completed successfully;false otherwise.

void
void
void
void
void
@NonNullTask<ContinuationResultT>
<ContinuationResultT>onSuccessTask(
    @NonNullSuccessContinuation<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.

@NonNullTask<ContinuationResultT>
<ContinuationResultT>onSuccessTask(
    @NonNullExecutor executor,
    @NonNullSuccessContinuation<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.

@NonNullStorageTask<ResultT>

Removes a listener.

@NonNullStorageTask<ResultT>

Removes a listener.

@NonNullStorageTask<ResultT>

Removes a listener.

@NonNullStorageTask<ResultT>

Removes a listener.

@NonNullStorageTask<ResultT>

Removes a listener.

@NonNullStorageTask<ResultT>

Removes a listener.

boolean

Attempts to resume a paused task.

Fromcom.google.android.gms.tasks.Task
Task<TResult>
Task<TResult>
abstractTask<TResult>
abstractTask<TResult>
Task<TContinuationResult>
<TContinuationResult>continueWith(
    Continuation<TResult, TContinuationResult> p
)
Task<TContinuationResult>
<TContinuationResult>continueWithTask(
    Continuation<TResult, Task<TContinuationResult>> p
)
abstractException
abstract TResult
abstract boolean
abstract boolean
abstract boolean
Task<TContinuationResult>
<TContinuationResult>onSuccessTask(
    SuccessContinuation<TResult, TContinuationResult> p
)

Protected methods

onCanceled

protected void onCanceled()

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.