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

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

operator StorageMetadata?

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

operator Uri?

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

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

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