RoutingFetcher class

Routes requests to child fetchers, depending on a provided predicate.

This can be used for example to serve a publication containing both local and remote resources, and more generally to concatenate different content sources.

The routes will be tested in the given order.

Inheritance

Constructors

RoutingFetcher(List<Route> routes)
RoutingFetcher.simple(Fetcher local, Fetcher remote)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
routes List<Route>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Closes any opened file handles, removes temporary files, etc.
override
get(Link link) Resource
Returns the Resource at the given link's HREF.
override
getWithHref(String href) Resource
Returns the Resource at the given href.
inherited
guessTitle() Future<String?>
inherited
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.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readAsJsonOrNull(String href) Future<Map<String, dynamic>?>
Returns the resource data as a JSON object at the given href, or null.
inherited
readAsXmlOrNull(String href) Future<XmlDocument?>
Returns the resource data as an XML Document at the given href, or null.
inherited
readBytes(Link link) Future<ByteData>
Returns the resource data at the given Link's HREF, or throws a Resource.Exception
inherited
readBytesWithHref(String href) Future<ByteData>
Returns the resource data at the given href, or throws a Resource.Exception
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited