DownloadFileUseCase

Downloads a file into the device's public/general storage (system Downloads location) — backs DownloadFile, the only one of the 3 download events whose destination the user can interactively cancel (reflected in DownloadFile's own OnCancelled trigger, handled above this use case). Reachable via get<DownloadFileUseCase>().

Constructors

Link copied to clipboard
constructor(repository: MosaicRepository)

Types

Link copied to clipboard
data class Params(val url: String, val headers: Map<String, String>?, val body: Any?, val httpMethod: HttpMethod, val targetFileName: String, val mimeType: String? = null, val onProgress: suspend (Float) -> Unit = {}, val onDownloadFinished: suspend () -> Unit = {}, val onDownloadFailure: suspend (Throwable) -> Unit = {})

Functions

Link copied to clipboard
open suspend override fun execute(params: DownloadFileUseCase.Params): Result<Unit>
Link copied to clipboard
suspend operator fun invoke(params: DownloadFileUseCase.Params): Result<Unit>