HttpContainer

class HttpContainer(baseUrl: Url? = null, val entries: Set<Url>, client: HttpClient) : Container<Resource>

Fetches remote resources through HTTP.

Since this container is used when doing progressive download streaming (e.g. audiobook), the HTTP byte range requests are open-ended and reused. This helps to avoid issuing too many requests.

Parameters

baseUrl

Base URL from which relative URLs are served.

entries

Entries of this container as Urls absolute or relative to baseUrl.

client

HTTP client used to perform HTTP requests.

Constructors

Link copied to clipboard
constructor(baseUrl: Url? = null, entries: Set<Url>, client: HttpClient)

Properties

Link copied to clipboard
open override val entries: Set<Url>
Link copied to clipboard

Direct source to this container, when available.

Functions

Link copied to clipboard
open override fun close()

Closes this object and releases any resources associated with it. If the object is already closed then invoking this method has no effect.

Link copied to clipboard
open operator override fun get(url: Url): Resource?

Returns the entry at the given url or null if there is none.

Link copied to clipboard
open operator override fun iterator(): Iterator<Url>
Link copied to clipboard
inline suspend fun <S> Container<Readable>.readDecodeOrNull(url: Url, decode: (ByteArray) -> Try<S, DecodeError>): S?