org.jdesktop.http
Class CookieManager
java.lang.Object
java.net.CookieHandler
org.jdesktop.http.CookieManager
public class CookieManager
- extends CookieHandler
A JVM-wide manager of HTTP Cookies.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
get
public Map<String,List<String>> get(URI uri,
Map<String,List<String>> requestHeaders)
throws IOException
- Description copied from class:
java.net.CookieHandler
- Gets all the applicable cookies from a cookie cache for the
specified uri in the request header.
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.
- Specified by:
get in class CookieHandler
- Parameters:
uri - a URI to send cookies to in a requestrequestHeaders - - a Map from request header
field names to lists of field values representing
the current request headers
- Returns:
- an immutable map from state management headers, with
field names "Cookie" or "Cookie2" to a list of
cookies containing state information
- Throws:
IOException - if an I/O * error occurs- See Also:
CookieHandler.put(URI, Map)
put
public void put(URI uri,
Map<String,List<String>> responseHeaders)
throws IOException
- Description copied from class:
java.net.CookieHandler
- Sets all the applicable cookies, examples are response header
fields that are named Set-Cookie2, present in the response
headers into a cookie cache.
- Specified by:
put in class CookieHandler
- Parameters:
uri - a URI where the cookies come fromresponseHeaders - an immutable map from field names to
lists of field values representing the response
header fields returned
- Throws:
IOException - if an I/O error occurs- See Also:
CookieHandler.get(URI, Map)
getCookies
public static Cookie[] getCookies(URI uri)
getCookies
public static Cookie[] getCookies(String host)
getCookies
public static Cookie[] getCookies()
install
public static void install()