com.google.firebase.storage

Interfaces

OnPausedListener

A listener that is called if the Task is paused via pause.

OnProgressListener

A listener that is called periodically during execution of the ControllableTask.

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 running FileDownloadTask

FirebaseStorage

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

ListResult

Contains the prefixes and items returned by a list call.

StorageMetadata

Metadata for a StorageReference.

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 running StreamDownloadTask

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 running UploadTask

Exceptions

StorageException

Represents an Exception resulting from an operation on a StorageReference.

Annotations

StorageException.ErrorCode

An ErrorCode indicates the source of a failed StorageTask or operation.

Top-level functions summary

StorageMetadata

Returns a StorageMetadata object initialized using the init function.

Extension functions summary

operator Long

Destructuring declaration for FileDownloadTask.TaskSnapshot to provide bytesTransferred.

operator List<StorageReference>

Destructuring declaration for ListResult to provide its items.

operator Long

Destructuring declaration for StreamDownloadTask.TaskSnapshot to provide bytesTransferred.

operator Long

Destructuring declaration for UploadTask.TaskSnapshot to provide bytesTransferred.

operator Long

Destructuring declaration for FileDownloadTask.TaskSnapshot to provide totalByteCount.

operator List<StorageReference>

Destructuring declaration for ListResult to provide its prefixes.

operator Long

Destructuring declaration for StreamDownloadTask.TaskSnapshot to provide totalByteCount.

operator Long

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

operator String?

Destructuring declaration for ListResult to provide its pageToken.

operator InputStream

Destructuring declaration for StreamDownloadTask.TaskSnapshot to provide its stream.

operator StorageMetadata?

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

operator Uri?

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

FirebaseStorage

Returns the FirebaseStorage instance of a given FirebaseApp and storage bucket url.

FirebaseStorage

Returns the FirebaseStorage instance of a given FirebaseApp.

FirebaseStorage

Returns the FirebaseStorage instance for a custom storage bucket at url.

Extension properties summary

FirebaseStorage

Returns the FirebaseStorage instance of the default FirebaseApp.

Flow<TaskState<T>>

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

Top-level functions

storageMetadata

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

Returns a StorageMetadata object initialized using the init function.

Extension functions

component1

operator fun FileDownloadTask.TaskSnapshot.component1(): Long

Destructuring declaration for FileDownloadTask.TaskSnapshot to provide bytesTransferred.

Returns
Long

the bytesTransferred of the FileDownloadTask.TaskSnapshot

component1

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

Destructuring declaration for ListResult to provide its items.

Returns
List<StorageReference>

the items of the ListResult

component1

operator fun StreamDownloadTask.TaskSnapshot.component1(): Long

Destructuring declaration for StreamDownloadTask.TaskSnapshot to provide bytesTransferred.

Returns
Long

the bytesTransferred of the StreamDownloadTask.TaskSnapshot

component1

operator fun UploadTask.TaskSnapshot.component1(): Long

Destructuring declaration for UploadTask.TaskSnapshot to provide bytesTransferred.

Returns
Long

the bytesTransferred of the UploadTask.TaskSnapshot

component2

operator fun FileDownloadTask.TaskSnapshot.component2(): Long

Destructuring declaration for FileDownloadTask.TaskSnapshot to provide totalByteCount.

Returns
Long

the totalByteCount of the FileDownloadTask.TaskSnapshot

component2

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

Destructuring declaration for ListResult to provide its prefixes.

Returns
List<StorageReference>

the prefixes of the ListResult

component2

operator fun StreamDownloadTask.TaskSnapshot.component2(): Long

Destructuring declaration for StreamDownloadTask.TaskSnapshot to provide totalByteCount.

Returns
Long

the totalByteCount of the StreamDownloadTask.TaskSnapshot

component2

operator fun UploadTask.TaskSnapshot.component2(): Long

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

Returns
Long

the totalByteCount of the UploadTask.TaskSnapshot

component3

operator fun ListResult.component3(): String?

Destructuring declaration for ListResult to provide its pageToken.

Returns
String?

the pageToken of the ListResult

component3

operator fun StreamDownloadTask.TaskSnapshot.component3(): InputStream

Destructuring declaration for StreamDownloadTask.TaskSnapshot to provide its stream.

Returns
InputStream

the stream of the StreamDownloadTask.TaskSnapshot

component3

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

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

Returns
StorageMetadata?

the metadata of the UploadTask.TaskSnapshot

component4

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

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

Returns
Uri?

the uploadSessionUri of the UploadTask.TaskSnapshot

storage

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

Returns the FirebaseStorage instance of a given FirebaseApp and storage bucket url.

storage

fun Firebase.storage(app: FirebaseApp): FirebaseStorage

Returns the FirebaseStorage instance of a given FirebaseApp.

storage

fun Firebase.storage(url: String): FirebaseStorage

Returns the FirebaseStorage instance for a custom storage bucket at url.

Extension properties

storage

val Firebase.storageFirebaseStorage

Returns the FirebaseStorage instance of the default FirebaseApp.

taskState

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

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