Package java.net
Class CacheResponse
- java.lang.Object
-
- java.net.CacheResponse
-
- Direct Known Subclasses:
SecureCacheResponse
public abstract class CacheResponse extends Object
A response cache entry. ACacheResponseobject provides anInputStreamto access the response body and aMapfor the response headers.- See Also:
ResponseCache
-
-
Constructor Summary
Constructors Constructor Description CacheResponse()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract InputStreamgetBody()Returns anInputStreamto access the response body.abstract Map<String,List<String>>getHeaders()Returns an immutableMapwhich contains the response headers information.
-
-
-
Method Detail
-
getBody
public abstract InputStream getBody() throws IOException
Returns anInputStreamto access the response body.- Returns:
- an
InputStreamwhich can be used to fetch the response body. - Throws:
IOException- if an I/O error is encountered while retrieving the response body.
-
getHeaders
public abstract Map<String,List<String>> getHeaders() throws IOException
Returns an immutableMapwhich contains the response headers information. Note thatURLConnectionmay need the original headers to be able to fully reconstruct the response. In particular, failure to provide a mapping from null to the original HTTP status line will prevent anHttpURLConnectionfrom returning the correct response code. SeeURLConnection.getHeaderFields().- Returns:
- an immutable
Mapwhich contains the response headers. - Throws:
IOException- if an I/O error is encountered while retrieving the response headers.
-
-