Package-level declarations

Types

Link copied to clipboard
fun interface BytesReceiver
Link copied to clipboard
abstract class Downloader(indexFile: IndexFile, outputFile: File)
DownloadRequest
Link copied to clipboard
data class DownloadRequest @JvmOverloads constructor(val indexFile: IndexFile, val mirrors: List<Mirror>, val proxy: ProxyConfig? = null, val username: String? = null, val password: String? = null, val tryFirstMirror: Mirror? = null)
data class DownloadRequest constructor(val indexFile: IndexFile, val mirrors: List<Mirror>, val proxy: <Error class: unknown class>? = null, val username: String? = null, val password: String? = null, val tryFirstMirror: Mirror? = null)
HeadInfo
Link copied to clipboard
data class HeadInfo(val eTagChanged: Boolean, val eTag: String?, val contentLength: Long?, val lastModified: String?)
data class HeadInfo(val eTagChanged: Boolean, val eTag: String?, val contentLength: Long?, val lastModified: String?)
Link copied to clipboard
class HttpDownloader(httpManager: HttpManager, request: DownloadRequest, destFile: File) : Downloader

Download files over HTTP, with support for proxies, .onion addresses, HTTP Basic Auth, etc.

Link copied to clipboard
class HttpDownloaderV2(httpManager: HttpManager, request: DownloadRequest, destFile: File) : Downloader

Download files over HTTP, with support for proxies, .onion addresses, HTTP Basic Auth, etc.

HttpManager
Link copied to clipboard
open class HttpManager @JvmOverloads constructor(userAgent: String, queryString: String? = null, proxyConfig: ProxyConfig? = null, customDns: Dns? = null, highTimeouts: Boolean = false, mirrorChooser: MirrorChooser = MirrorChooserRandom(), httpClientEngineFactory: HttpClientEngineFactory<*> = getHttpClientEngineFactory( customDns ))
open class HttpManager constructor(userAgent: String, queryString: String? = null, proxyConfig: <Error class: unknown class>? = null, customDns: <Error class: unknown class>? = null, highTimeouts: Boolean = false, mirrorChooser: MirrorChooser = MirrorChooserRandom(), httpClientEngineFactory: <Error class: unknown class><out <Error class: unknown class>> = getHttpClientEngineFactory( customDns ))
Link copied to clipboard
class HttpPoster(httpManager: HttpManager, url: String)

HTTP POST a JSON string to the URL configured in the constructor.

Mirror
Link copied to clipboard
data class Mirror @JvmOverloads constructor(val baseUrl: String, val location: String? = null, val isIpfsGateway: Boolean = false)
data class Mirror constructor(val baseUrl: String, val location: String? = null, val isIpfsGateway: Boolean = false)
MirrorChooser
Link copied to clipboard
interface MirrorChooser
interface MirrorChooser
NoResumeException
Link copied to clipboard

Thrown if we tried to resume a download, but the current mirror server does not offer resuming.

Thrown if we tried to resume a download, but the current mirror server does not offer resuming.

NotFoundException
Link copied to clipboard

Thrown when a file was not found. Catching this is useful when checking if a new index version exists and then falling back to an older version.

class NotFoundException(e: Throwable? = null)

Thrown when a file was not found. Catching this is useful when checking if a new index version exists and then falling back to an older version.

Functions

Link copied to clipboard

Gets the InputStream for the given request as a DigestInputStream, so you can verify the SHA-256 hash. If you don't need to verify the hash, use getInputStream instead.

Link copied to clipboard