Resource Provider
The ResourceProvider is an abstraction hiding the details about resource retrieval from the reading system.
You can fetch a resource from a ResourceProvider by calling the fetch method with the resource's URL. How the ResourceProvider fetches the resource is an implementation detail.
You can load container-based publication formats such as EPUBs into the ReadingSystemEngine by using a ResourceProvider. In this case, you create a ResourceProvider that can fetch resources from the EPUB and pass it to ReadingSystemEngine.loadEpub
. For normal EPUB files, you use the ZipResourceProvider
which can fetch resources from ZIP archives.
You can create your own ResourceProvider implementation to for example provide resources from an unpacked EPUB stored on the device, or from a remote server.
Note that all ResourceProvider methods execute synchronously, and should be NOT called using the Main thread. All methods and properties must be thread safe, as they can be called by multiple threads at the same time.
Inheritors
Functions
Returns true if this ResourceProvider can handle the given relative or absolute URL.
Synchronously fetches a resource from this ResourceProvider using the provided url. The method returns when a successful response is available, or throws an exception on failure.
Synchronously fetches metadata about a resource from this ResourceProvider. The method returns when resource metadata is available, or throws an Exception on failure.