com.google.firebase.storage

Interfaces

OnPausedListener

A listener that is called if the Task is paused viapause.

OnProgressListener

A listener that is called periodically during execution of theControllableTask.

StorageTask.ProvideError

An object that returns an exception.

StreamDownloadTask.StreamProcessor

A callback that is used to handle the stream download

Classes

CancellableTask

Represents an asynchronous operation that can be canceled.

ControllableTask

Represents an asynchronous operation that can be paused, resumed and canceled.

FileDownloadTask

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

FileDownloadTask.TaskSnapshot

Encapsulates state about the runningFileDownloadTask

FirebaseStorage

FirebaseStorage is a service that supports uploading and downloading large objects to Google Cloud Storage.

ListResult

Contains the prefixes and items returned by alist call.

StorageMetadata

Metadata for aStorageReference.

StorageMetadata.Builder

Creates a StorageMetadata object.

StorageReference

Represents a reference to a Google Cloud Storage object.

StorageTask

A controllable Task that has a synchronized state machine.

StorageTask.SnapshotBase

Base class for state.

StreamDownloadTask

A task that downloads bytes of a GCS blob.

StreamDownloadTask.TaskSnapshot

Encapsulates state about the runningStreamDownloadTask

TaskState

Used to emit events about the progress of storage tasks.

TaskState.InProgress

Called periodically as data is transferred and can be used to populate an upload/download indicator.

TaskState.Paused

Called any time the upload/download is paused.

UploadTask

An controllable task that uploads and fires events for success, progress and failure.

UploadTask.TaskSnapshot

Encapsulates state about the runningUploadTask

Exceptions

StorageException

Represents an Exception resulting from an operation on aStorageReference.

Annotations

StorageException.ErrorCode

AnErrorCode indicates the source of a failed StorageTask or operation.

Top-level functions summary

StorageMetadata

Returns aStorageMetadata object initialized using theinit function.

Extension functions summary

operatorLong

Destructuring declaration forFileDownloadTask.TaskSnapshot to provide bytesTransferred.

operatorList<StorageReference>

Destructuring declaration forListResult to provide its items.

operatorLong

Destructuring declaration forStreamDownloadTask.TaskSnapshot to provide bytesTransferred.

operatorLong

Destructuring declaration forUploadTask.TaskSnapshot to provide bytesTransferred.

operatorLong

Destructuring declaration forFileDownloadTask.TaskSnapshot to provide totalByteCount.

operatorList<StorageReference>

Destructuring declaration forListResult to provide its prefixes.

operatorLong

Destructuring declaration forStreamDownloadTask.TaskSnapshot to provide totalByteCount.

operatorLong

Destructuring declaration forUploadTask.TaskSnapshot to provide totalByteCount.

operatorString?

Destructuring declaration forListResult to provide its pageToken.

operatorInputStream

Destructuring declaration forStreamDownloadTask.TaskSnapshot to provide its stream.

operatorStorageMetadata?

Destructuring declaration forUploadTask.TaskSnapshot to provide its metadata.

operatorUri?

Destructuring declaration forUploadTask.TaskSnapshot to provide its uploadSessionUri.

FirebaseStorage

Returns theFirebaseStorage instance of a givenFirebaseApp and storage bucketurl.

FirebaseStorage

Returns theFirebaseStorage instance of a givenFirebaseApp.

FirebaseStorage

Returns theFirebaseStorage instance for a custom storage bucket aturl.

Extension properties summary

FirebaseStorage

Returns theFirebaseStorage instance of the defaultFirebaseApp.

Flow<TaskState<T>>

Starts listening to this task's progress and emits its values via aFlow.

Top-level functions

storageMetadata

fun storageMetadata(init: StorageMetadata.Builder.()->Unit): StorageMetadata

Returns aStorageMetadata object initialized using theinit function.

Extension functions

component1

operator fun FileDownloadTask.TaskSnapshot.component1(): Long

Destructuring declaration forFileDownloadTask.TaskSnapshot to provide bytesTransferred.

Returns
Long

the bytesTransferred of theFileDownloadTask.TaskSnapshot

component1

operator fun ListResult.component1(): List<StorageReference>

Destructuring declaration forListResult to provide its items.

Returns
List<StorageReference>

the items of theListResult

component1

operator fun StreamDownloadTask.TaskSnapshot.component1(): Long

Destructuring declaration forStreamDownloadTask.TaskSnapshot to provide bytesTransferred.

Returns
Long

the bytesTransferred of theStreamDownloadTask.TaskSnapshot

component1

operator fun UploadTask.TaskSnapshot.component1(): Long

Destructuring declaration forUploadTask.TaskSnapshot to provide bytesTransferred.

Returns
Long

the bytesTransferred of theUploadTask.TaskSnapshot

component2

operator fun FileDownloadTask.TaskSnapshot.component2(): Long

Destructuring declaration forFileDownloadTask.TaskSnapshot to provide totalByteCount.

Returns
Long

the totalByteCount of theFileDownloadTask.TaskSnapshot

component2

operator fun ListResult.component2(): List<StorageReference>

Destructuring declaration forListResult to provide its prefixes.

Returns
List<StorageReference>

the prefixes of theListResult

component2

operator fun StreamDownloadTask.TaskSnapshot.component2(): Long

Destructuring declaration forStreamDownloadTask.TaskSnapshot to provide totalByteCount.

Returns
Long

the totalByteCount of theStreamDownloadTask.TaskSnapshot

component2

operator fun UploadTask.TaskSnapshot.component2(): Long

Destructuring declaration forUploadTask.TaskSnapshot to provide totalByteCount.

Returns
Long

the totalByteCount of theUploadTask.TaskSnapshot

component3

operator fun ListResult.component3(): String?

Destructuring declaration forListResult to provide its pageToken.

Returns
String?

the pageToken of theListResult

component3

operator fun StreamDownloadTask.TaskSnapshot.component3(): InputStream

Destructuring declaration forStreamDownloadTask.TaskSnapshot to provide its stream.

component3

operator fun UploadTask.TaskSnapshot.component3(): StorageMetadata?

Destructuring declaration forUploadTask.TaskSnapshot to provide its metadata.

Returns
StorageMetadata?

the metadata of theUploadTask.TaskSnapshot

component4

operator fun UploadTask.TaskSnapshot.component4(): Uri?

Destructuring declaration forUploadTask.TaskSnapshot to provide its uploadSessionUri.

Returns
Uri?

the uploadSessionUri of theUploadTask.TaskSnapshot

storage

fun Firebase.storage(app: FirebaseApp, url: String): FirebaseStorage

Returns theFirebaseStorage instance of a givenFirebaseApp and storage bucketurl.

storage

fun Firebase.storage(app: FirebaseApp): FirebaseStorage

Returns theFirebaseStorage instance of a givenFirebaseApp.

storage

fun Firebase.storage(url: String): FirebaseStorage

Returns theFirebaseStorage instance for a custom storage bucket aturl.

Extension properties

storage

val Firebase.storageFirebaseStorage

Returns theFirebaseStorage instance of the defaultFirebaseApp.

taskState

val StorageTask<T>.taskStateFlow<TaskState<T>>

Starts listening to this task's progress and emits its values via aFlow.

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.