FileDocCategorySizeDatePackage
CookieHandler.javaAPI DocAndroid 1.5 API3308Wed May 06 22:41:04 BST 2009java.net

CookieHandler

public abstract class CookieHandler extends Object
This class provides a way to manage cookies with a HTTP protocol handler.
since
Android 1.0

Fields Summary
private static CookieHandler
systemWideCookieHandler
private static final NetPermission
getCookieHandlerPermission
private static final NetPermission
setCookieHandlerPermission
Constructors Summary
Methods Summary
public abstract java.util.Mapget(java.net.URI uri, java.util.Map requestHeaders)
Gets all cookies for a specific URI from the cookie cache.

param
uri a URI to search for applicable cookies.
param
requestHeaders a list of request headers.
return
an unchangeable map of all appropriate cookies.
throws
IOException if an error occurs during the I/O operation.
since
Android 1.0

public static java.net.CookieHandlergetDefault()
Returns the system-wide cookie handler or {@code null} if not set.

return
the system-wide cookie handler.
since
Android 1.0

 //$NON-NLS-1$

                             
        
        SecurityManager sm = System.getSecurityManager();
        if (null != sm) {
            sm.checkPermission(getCookieHandlerPermission);
        }
        return systemWideCookieHandler;
    
public abstract voidput(java.net.URI uri, java.util.Map responseHeaders)
Sets all cookies of a specific URI in the {@code responseHeaders} into the cookie cache.

param
uri the origin URI of the cookies.
param
responseHeaders a list of request headers.
throws
IOException if an error occurs during the I/O operation.
since
Android 1.0

public static voidsetDefault(java.net.CookieHandler cHandler)
Sets the system-wide cookie handler.

param
cHandler a cookie handler to set as the system-wide default handler.
since
Android 1.0

        SecurityManager sm = System.getSecurityManager();
        if (null != sm) {
            sm.checkPermission(setCookieHandlerPermission);
        }
        systemWideCookieHandler = cHandler;