CacheResponse in Java

java.net.CacheResponse

Represent channels for retrieving resources from theResponseCache. Instances of such a class provide anInputStream that returns the entity body, and also agetHeaders() method which returns the associated response headers.

Declaration

public abstract class CacheResponse {

    public abstract Map<String, List<String>>
getHeaders() throws IOException;

    public abstract InputStream getBody() throws IOException;
}

Methods

1. getHeaders()

Map<String, List<String>> java.net.CacheResponse.getHeaders() throws IOException

Returns the response headers as a Map.

Returns: An immutable Map from response header field names to lists of field values. The status line has null as its field name.

Throws:

IOException - if an I/O error occurs while getting the response headers.


2. getBody()

InputStream java.net.CacheResponse.getBody() throws IOException

Returns the response body as an InputStream.

Returns: an InputStream from which the response body can be accessed.

Throws:

IOException - if an I/O error occurs while getting the response body.


Some other classes/interfaces of java.net

AuthenticatorThe class Authenticator represents an object that knows how to obtain authentication for a network connection.

BindExceptionSignals that an error occurred while attempting to bind a socket to a local address and port. 

CacheRequestRepresents channels for storing resources in the ResponseCache.

CacheResponseRepresent channels for retrieving resources from the ResponseCache.

ConnectExceptionSignals that an error occurred while attempting to connect a socket to a remote address and port.

ContentHandlerThe abstract class ContentHandler is the superclass of all classes that read an Object from a URLConnection.

ContentHandlerFactoryThis interface defines a factory for content handlers. Implementing this interface should map a MIME type into an instance of ContentHandler.

CookieHandlerA CookieHandler object provides a callback mechanism to hook up an HTTP state management policy implementation into the HTTP protocol handler.

CookieManagerCookieManager provides a concrete implementation of CookieHandler, which separates the storage of cookies from the policy surrounding accepting and rejecting cookies. 

CookiePolicyCookiePolicy implementations decide which cookies should be accepted and which should be rejected.

CookieStoreA CookieStore object represents storage for cookies. Can store and retrieve cookies.

DatagramPacketThis class represents a datagram packet.

No comments:

Post a Comment