UploadTask.TaskSnapshot

public class UploadTask.TaskSnapshot extends StorageTask.SnapshotBase


Encapsulates state about the running UploadTask

Summary

Extension functions

final long

Destructuring declaration for UploadTask.TaskSnapshot to provide bytesTransferred.

final long

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

final long

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

final long

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

final StorageMetadata

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

final StorageMetadata

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

final Uri

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

final Uri

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

Inherited methods

From com.google.firebase.storage.StorageTask.SnapshotBase
@Nullable Exception

Returns the last error encountered.

@NonNull StorageReference

Returns the target of the upload.

@NonNull StorageTask<ResultT>

Returns the StorageTask for this state.

Public methods

getBytesTransferred

public long getBytesTransferred()
Returns
long

the total bytes uploaded so far.

getMetadata

public @Nullable StorageMetadata getMetadata()
Returns
@Nullable StorageMetadata

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

getTotalByteCount

public long getTotalByteCount()
Returns
long

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

getUploadSessionUri

public @Nullable Uri getUploadSessionUri()
Returns
@Nullable 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

StorageKt.component1

public final long StorageKt.component1(@NonNull UploadTask.TaskSnapshot receiver)

Destructuring declaration for UploadTask.TaskSnapshot to provide bytesTransferred.

Returns
long

the bytesTransferred of the UploadTask.TaskSnapshot

StorageKt.component1

public final long StorageKt.component1(@NonNull UploadTask.TaskSnapshot receiver)

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

StorageKt.component2

public final long StorageKt.component2(@NonNull UploadTask.TaskSnapshot receiver)

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

Returns
long

the totalByteCount of the UploadTask.TaskSnapshot

StorageKt.component2

public final long StorageKt.component2(@NonNull UploadTask.TaskSnapshot receiver)

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

StorageKt.component3

public final StorageMetadata StorageKt.component3(@NonNull UploadTask.TaskSnapshot receiver)

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

Returns
StorageMetadata

the metadata of the UploadTask.TaskSnapshot

StorageKt.component3

public final StorageMetadata StorageKt.component3(@NonNull UploadTask.TaskSnapshot receiver)

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

StorageKt.component4

public final Uri StorageKt.component4(@NonNull UploadTask.TaskSnapshot receiver)

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

Returns
Uri

the uploadSessionUri of the UploadTask.TaskSnapshot

StorageKt.component4

public final Uri StorageKt.component4(@NonNull UploadTask.TaskSnapshot receiver)

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