to top
Android APIs
public abstract class

CookieHandler

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

Class Overview

This class provides a way to manage cookies with a HTTP protocol handler.

Summary

Public Constructors
CookieHandler()
Public Methods
abstract Map< StringList< String>> get( URI uri, Map< StringList< String>> requestHeaders)
Gets all cookies for a specific URI from the cookie cache.
static CookieHandler getDefault()
Returns the system-wide cookie handler or null if not set.
abstract void put( URI uri, Map< StringList< String>> responseHeaders)
Sets all cookies of a specific URI in the responseHeaders into the cookie cache.
static void setDefault( CookieHandler cHandler)
Sets the system-wide cookie handler.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CookieHandler ()

Added in API level 1

Public Methods

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

Added in API level 1

Gets all cookies for a specific URI from the cookie cache.

Parameters
uri a URI to search for applicable cookies.
requestHeaders a list of request headers.
Returns
  • an unchangeable map of all appropriate cookies.
Throws
IOException if an error occurs during the I/O operation.

public static CookieHandler getDefault ()

Added in API level 1

Returns the system-wide cookie handler or null if not set.

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

Added in API level 1

Sets all cookies of a specific URI in the responseHeaders into the cookie cache.

Parameters
uri the origin URI of the cookies.
responseHeaders a list of request headers.
Throws
IOException if an error occurs during the I/O operation.

public static void setDefault (CookieHandler cHandler)

Added in API level 1

Sets the system-wide cookie handler.

No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.