Package 

Class HttpContainer

  • All Implemented Interfaces:
    kotlin.collections.Iterable , org.readium.r2.shared.util.SuspendingCloseable , org.readium.r2.shared.util.data.Container

    
    public final class HttpContainer
     implements 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.

    • Method Summary

      Modifier and Type Method Description
      Set<Url> getEntries()
      AbsoluteUrl getSourceUrl()
      Resource get(Url url) Returns the entry at the given url or null if there is none.
      Unit close() Closes this object and releases any resources associated with it.
      • Methods inherited from class org.readium.r2.shared.util.http.HttpContainer

        iterator
      • Methods inherited from class org.readium.r2.shared.util.data.Container

        forEach, spliterator
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpContainer

        HttpContainer(Url baseUrl, Set<Url> entries, HttpClient client)
        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.