Top Description Fields Constructors Methods
com.sun.webkit.network

public final Class CookieManager

extends CookieHandler
Class Inheritance
Imports
com.sun.javafx.logging.PlatformLogger, .PlatformLogger.Level, java.net.CookieHandler, .URI, java.util.Arrays, .Collections, .HashMap, .List, .ListIterator, .Map

An RFC 6265-compliant cookie handler.

Field Summary

Modifier and TypeField and Description
private static final PlatformLogger
private final CookieStore

Constructor Summary

AccessConstructor and Description
public
CookieManager()

Creates a new CookieManager.

Method Summary

Modifier and TypeMethod and Description
private static String
canonicalize(String hostname)

Canonicalizes a hostname as required by RFC 6265.

public Map<String, List<String>>
get(URI
a URI representing the intended use for the cookies
uri
,
Map<String, List<String>>
a Map from request header field names to lists of field values representing the current request headers
requestHeaders
)

Implements abstract java.net.CookieHandler.get.

Gets all the applicable cookies from a cookie cache for the specified uri in the request header.

private String
get(URI uri)

Returns the cookie string for a given URI.

public void
put(URI
a URI where the cookies come from
uri
,
Map<String, List<String>>
an immutable map from field names to lists of field values representing the response header fields returned
responseHeaders
)

Implements abstract java.net.CookieHandler.put.

Sets all the applicable cookies, examples are response header fields that are named Set-Cookie2, present in the response headers into a cookie cache.

private void
put(URI uri, Cookie cookie)

Puts an individual cookie.

private static String
toLogString(Map<String, List<String>> headers)

Converts a map of HTTP headers to a string suitable for displaying in the log.

Inherited from java.net.CookieHandler:
getDefaultsetDefault

Field Detail

loggerback to summary
private static final PlatformLogger logger
storeback to summary
private final CookieStore store

Constructor Detail

CookieManagerback to summary
public CookieManager()

Creates a new CookieManager.

Method Detail

canonicalizeback to summary
private static String canonicalize(String hostname)

Canonicalizes a hostname as required by RFC 6265.

getback to summary
public Map<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders)

Implements abstract java.net.CookieHandler.get.

Doc from java.net.CookieHandler.get.

Gets all the applicable cookies from a cookie cache for the specified uri in the request header.

The URI passed as an argument specifies the intended use for the cookies. In particular the scheme should reflect whether the cookies will be sent over http, https or used in another context like javascript. The host part should reflect either the destination of the cookies or their origin in the case of javascript.

It is up to the implementation to take into account the URI and the cookies attributes and security settings to determine which ones should be returned.

HTTP protocol implementers should make sure that this method is called after all request headers related to choosing cookies are added, and before the request is sent.

Parameters
uri:URI

a URI representing the intended use for the cookies

requestHeaders:Map<String, List<String>>

a Map from request header field names to lists of field values representing the current request headers

Returns:Map<String, List<String>>

an immutable map from state management headers, with field names "Cookie" or "Cookie2" to a list of cookies containing state information

Annotations
@Override
getback to summary
private String get(URI uri)

Returns the cookie string for a given URI.

putback to summary
public void put(URI uri, Map<String, List<String>> responseHeaders)

Implements abstract java.net.CookieHandler.put.

Doc from java.net.CookieHandler.put.

Sets all the applicable cookies, examples are response header fields that are named Set-Cookie2, present in the response headers into a cookie cache.

Parameters
uri:URI

a URI where the cookies come from

responseHeaders:Map<String, List<String>>

an immutable map from field names to lists of field values representing the response header fields returned

Annotations
@Override
putback to summary
private void put(URI uri, Cookie cookie)

Puts an individual cookie.

toLogStringback to summary
private static String toLogString(Map<String, List<String>> headers)

Converts a map of HTTP headers to a string suitable for displaying in the log.