Build 1.0_r1(from source)

java.net
Class CookieHandler

java.lang.Object
  extended by java.net.CookieHandler

public abstract class CookieHandler
extends Object

This class is ready for managing a stateful cookie with HTTP protocol


Constructor Summary
CookieHandler()
           
 
Method Summary
abstract  Map<String,List<String>> get(URI uri, Map<String,List<String>> requestHeaders)
          Searchs and gets all cookies in the cache by the specified uri in the request header.
static CookieHandler getDefault()
          Returns a system-wide cookie handler, or null if not set
abstract  void put(URI uri, Map<String,List<String>> responseHeaders)
          Sets cookies according to uri and responseHeaders
static void setDefault(CookieHandler cHandler)
          sets a system-wide cookie handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieHandler

public CookieHandler()
Method Detail

getDefault

public static CookieHandler getDefault()
Returns a system-wide cookie handler, or null if not set

Returns:
a cookie handler

setDefault

public static void setDefault(CookieHandler cHandler)
sets a system-wide cookie handler

Parameters:
cHandler - the cookie handler to set

get

public abstract Map<String,List<String>> get(URI uri,
                                             Map<String,List<String>> requestHeaders)
                                      throws IOException
Searchs and gets all cookies in the cache by the specified uri in the request header.

Parameters:
uri - the specified uri to search for
requestHeaders - a list of request headers
Returns:
a map that record all such cookies, the map is unchangeable
Throws:
IOException - if some error of I/O operation occurs

put

public abstract void put(URI uri,
                         Map<String,List<String>> responseHeaders)
                  throws IOException
Sets cookies according to uri and responseHeaders

Parameters:
uri - the specified uri
responseHeaders - a list of request headers
Throws:
IOException - if some error of I/O operation occurs

Build 1.0_r1(from source)

Please submit a feedback, bug or feature