Package 

Class TransformingFetcher

  • All Implemented Interfaces:
    org.readium.r2.shared.fetcher.Fetcher , org.readium.r2.shared.util.SuspendingCloseable

    
    public final class TransformingFetcher
     implements Fetcher
                        

    Transforms the resources' content of a child fetcher using a list of ResourceTransformer functions.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      List<Link> links() Known resources available in the medium, such as file paths on the file system or entries in a ZIP archive.
      Resource get(Link link) Returns the Resource at the given link's HREF.
      Unit close() Closes this object and releases any resources associated with it.
      • Methods inherited from class org.readium.r2.shared.fetcher.Fetcher

        get
      • Methods inherited from class java.lang.Object

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

      • links

         List<Link> links()

        Known resources available in the medium, such as file paths on the file system or entries in a ZIP archive. This list is not exhaustive, and additional unknown resources might be reachable.

        If the medium has an inherent resource order, it should be followed. Otherwise, HREFs are sorted alphabetically.

      • get

         Resource get(Link link)

        Returns the Resource at the given link's HREF.

        A Resource is always returned, since for some cases we can't know if it exists before actually fetching it, such as HTTP. Therefore, errors are handled at the Resource level.

      • close

         Unit close()

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