Android
java.net
public abstract class

java.net.CookieHandler

java.lang.Object
java.net.CookieHandler

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

Summary

Public Constructors

            CookieHandler()

Public Methods

abstract          Map<StringList<String>>  get(URI uri, Map<StringList<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<StringList<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

Details

Public Constructors

public CookieHandler()

Public Methods

public abstract Map<StringList<String>> get(URI uri, Map<StringList<String>> requestHeaders)

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

public static CookieHandler getDefault()

Returns a system-wide cookie handler, or null if not set

Returns

  • a cookie handler

public abstract void put(URI uri, Map<StringList<String>> responseHeaders)

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

public static void setDefault(CookieHandler cHandler)

sets a system-wide cookie handler

Parameters

cHandler the cookie handler to set
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56