Scoop API

scoop:scoop.http.client:0.1.0

HttpDownloadOptions

class HttpDownloadOptions

source · line 12
public
public class HttpDownloadOptions internal constructor(
    /**
     * Whether atomic publication may replace an existing destination.
     */
    public val replaceExisting: Boolean = false,
    /**
     * Whether file contents are synchronized before the final commit.
     */
    public val syncOnCommit: Boolean = false,
    /**
     * The positive byte-buffer size used while streaming to disk.
     */
    public val bufferSize: Long = 8192L,
    /**
     * Suspend callback for written-byte progress; it participates in cancellation and failure
     * cleanup.
     */
    public val onProgress: suspend (HttpDownloadProgress) -> Unit = suspend { _ -> }
)

Download publication, buffering, and progress policy. Completion atomically installs the destination; failures retain the prior destination.

Extensions

property replaceExisting

source · line 16
public
public val replaceExisting: Boolean = false

get: public read-only

Whether atomic publication may replace an existing destination.

property onProgress

source · line 29
public
public val onProgress: suspend (HttpDownloadProgress) -> Unit = suspend { _ -> }

get: public read-only

Suspend callback for written-byte progress; it participates in cancellation and failure cleanup.

property bufferSize

source · line 24
public
public val bufferSize: Long = 8192L

get: public read-only

The positive byte-buffer size used while streaming to disk.

property syncOnCommit

source · line 20
public
public val syncOnCommit: Boolean = false

get: public read-only

Whether file contents are synchronized before the final commit.