This class is an implementation of {@code URLConnection} caches intended
primarily for the according stream handler implementations.
The system's default cache can be registered by invoking the method {@code
setDefault(ResponseCache)} and be retrieved by invoking the method {@code
getDefault()}. If {@code URLConnection#useCaches} is set, {@code
URLConnection} class will use {@code ResponseCache} to store and get
resources.
Whether the resource is cached depends on the implementation of {@code
ResponseCache}. If so, a {@code CacheResponse} is returned from which the
stream handler reads. If the stream handler fails to get a resource from the
cache, it must get the resource from its original location.
To write to the cache, the protocol handlers call {@code put()}, upon which a
{@code CacheRequest} is supplied to which the resources are written.
|