UploadTask.TaskSnapshot

class UploadTask.TaskSnapshot : StorageTask.SnapshotBase


Encapsulates state about the running UploadTask

Summary

Extension functions

operator Long

Destructuring declaration for UploadTask.TaskSnapshot to provide bytesTransferred.

operator Long

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

operator Long

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

operator Long

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

operator StorageMetadata?

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

operator StorageMetadata?

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

operator Uri?

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

operator Uri?

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Inherited functions

From com.google.firebase.storage.StorageTask.SnapshotBase
Exception?

Returns the last error encountered.

StorageReference

Returns the target of the upload.

StorageTask<ResultT!>

Returns the StorageTask for this state.

Public functions

getBytesTransferred

fun getBytesTransferred(): Long
Returns
Long

the total bytes uploaded so far.

getMetadata

fun getMetadata(): StorageMetadata?
Returns
StorageMetadata?

the metadata for the object. After uploading, this will return the resulting final Metadata which will include the upload URL.

getTotalByteCount

fun getTotalByteCount(): Long
Returns
Long

The number of bytes to upload. Will return -1 if uploading from a stream.

getUploadSessionUri

fun getUploadSessionUri(): Uri?
Returns
Uri?

the session Uri, valid for approximately one week, which can be used to resume an upload later by passing this value into putFile

Extension functions

component1

operator fun UploadTask.TaskSnapshot.component1(): Long

Destructuring declaration for UploadTask.TaskSnapshot to provide bytesTransferred.

Returns
Long

the bytesTransferred of the UploadTask.TaskSnapshot

component1

operator fun UploadTask.TaskSnapshot.component1(): Long

Destructuring declaration for UploadTask.TaskSnapshot to provide bytesTransferred.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-storage-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

Returns
Long

the bytesTransferred of the UploadTask.TaskSnapshot

component2

operator fun UploadTask.TaskSnapshot.component2(): Long

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

Returns
Long

the totalByteCount of the UploadTask.TaskSnapshot

component2

operator fun UploadTask.TaskSnapshot.component2(): Long

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-storage-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

Returns
Long

the totalByteCount of the UploadTask.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

component3

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

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-storage-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

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

component4

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

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-storage-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

Returns
Uri?

the uploadSessionUri of the UploadTask.TaskSnapshot