DownloadClient

A service class for downloading files

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
class FailedDownloadException(message: String, val statusCode: Int = 404, err: Throwable? = null) : RuntimeException

Indicates that the client couldn't download a given resource

Link copied to clipboard

Indicates that the integrity of a downloaded file couldn't be verified with the given checksum

Link copied to clipboard
data class Resource(val url: URI, val checksum: String, val algorithm: String = "SHA-256") : Serializable

Data describing a downloadable file

Functions

Link copied to clipboard
fun download(resource: DownloadClient.Resource, target: Path)

Downloads a resource, checks its integrity, and stores it to a target path