Name

CookieHandler

Synopsis

This abstract class defines an API to be implemented by an application that wants to manage HTTP cookies for networking done via the URL class. Install an implementation of this class with the setDefault( ) method. The default HTTP protocol handler uses getDefault( ) to obtain the CookieHandler implementation. The protocol handler then calls get( ) when it wants the CookieHandler to copy cookie values into HTTP request headers and calls put( ) when it wants the CookieHandler to read a set of response headers and store the cookies they contain.

This class is intended to be subclassed by advanced users of the package; it is not intended for casual users.

public abstract class CookieHandler {
// Public Constructors
     public CookieHandler( );  
// Public Class Methods
     public static CookieHandler getDefault( );      synchronized
     public static void setDefault(CookieHandler cHandler);       synchronized
                  // Public Instance Methods
     public abstract java.util.Map<String,java.util.List<String>> 
get(URI uri, java.util.Map<String,java.util.List<String>> requestHeaders) 
throws java.io.IOException;
     public abstract void put(URI uri, java.util.Map<String,
java.util.List<String>> responseHeaders) 
throws java.io.IOException;  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.