Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public abstract class

CacheResponse

extends Object
java.lang.Object
   ↳ java.net.CacheResponse
Known Direct Subclasses

Class Overview

A response cache entry. A CacheResponse object provides an InputStream to access the response body and a Map for the response headers.

Summary

Public Constructors
CacheResponse ()
Public Methods
abstract InputStream getBody ()
Returns an InputStream to access the response body.
abstract Map < String List < String >> getHeaders ()
Returns an immutable Map which contains the response headers information.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CacheResponse ()

Added in API level 1

Public Methods

public abstract InputStream getBody ()

Added in API level 1

Returns an InputStream to access the response body.

Returns
  • an InputStream which can be used to fetch the response body.
Throws
IOException if an I/O error is encountered while retrieving the response body.

public abstract Map < String List < String >> getHeaders ()

Added in API level 1

Returns an immutable Map which contains the response headers information. Note that URLConnection may 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 an HttpURLConnection from returning the correct response code. See getHeaderFields() .

Returns
  • an immutable Map which contains the response headers.
Throws
IOException if an I/O error is encountered while retrieving the response headers.