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

Destructuring declaration for UploadTask.TaskSnapshot to provide totalByteCount.

final StorageMetadata

Destructuring declaration for UploadTask.TaskSnapshot to provide its metadata.

final Uri

Destructuring declaration for UploadTask.TaskSnapshot to provide its uploadSessionUri.

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