DownloadRequest

data class DownloadRequest(val id: String, val url: String, val savePath: String, val expectedChecksum: String? = null, val headers: Map<String, String> = emptyMap(), val resumable: Boolean = true)

Describes a file download to be performed in the background.

val download = DownloadRequest(
id = "avatar-download",
url = "https://cdn.example.com/avatar.jpg",
savePath = "/data/files/avatar.jpg",
expectedChecksum = "sha256:abc123...",
headers = mapOf("Authorization" to "Bearer token")
)
transferManager.download(download)

Parameters

id

Unique task identifier.

url

URL to download from.

savePath

Local file path to save the downloaded file.

expectedChecksum

Optional SHA-256 checksum for verification (format: "sha256:hex").

headers

Optional HTTP headers to include.

resumable

Whether to support resume on interrupted downloads.

Constructors

Link copied to clipboard
constructor(id: String, url: String, savePath: String, expectedChecksum: String? = null, headers: Map<String, String> = emptyMap(), resumable: Boolean = true)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard
val resumable: Boolean = true
Link copied to clipboard
Link copied to clipboard
val url: String