org.abstracthorizon.danube.http.cookie
Class CookieUtilities

java.lang.Object
  extended by org.abstracthorizon.danube.http.cookie.CookieUtilities

public class CookieUtilities
extends Object

Cookie utilities class

Author:
Daniel Sendula

Field Summary
static String REQUEST_COOKIE_HEADER
           
static String REQUEST_COOKIES_ATTRIBUTE
           
static String RESPONSE_COOKIE_HEADER
           
static String RESPONSE_COOKIES_ATTRIBUTE
           
 
Constructor Summary
CookieUtilities()
           
 
Method Summary
static void addResponseCookies(HTTPConnection connection, Collection<Cookie> cookies)
          Adds response cookie
static Map<String,Cookie> getRequestCookies(HTTPConnection connection)
          Obtains request cookies as a map
static Map<String,Cookie> getResponseCookies(HTTPConnection connection)
          Returns all response cookies as a map
protected static Map<String,String> obtainCookieHeaders(MultiStringMap responseHeaders)
          Obtains cookie headers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESPONSE_COOKIES_ATTRIBUTE

public static final String RESPONSE_COOKIES_ATTRIBUTE
See Also:
Constant Field Values

RESPONSE_COOKIE_HEADER

public static final String RESPONSE_COOKIE_HEADER
See Also:
Constant Field Values

REQUEST_COOKIES_ATTRIBUTE

public static final String REQUEST_COOKIES_ATTRIBUTE
See Also:
Constant Field Values

REQUEST_COOKIE_HEADER

public static final String REQUEST_COOKIE_HEADER
See Also:
Constant Field Values
Constructor Detail

CookieUtilities

public CookieUtilities()
Method Detail

getResponseCookies

public static Map<String,Cookie> getResponseCookies(HTTPConnection connection)
Returns all response cookies as a map

Parameters:
connection - http connection
Returns:
response cookies as a map

addResponseCookies

public static void addResponseCookies(HTTPConnection connection,
                                      Collection<Cookie> cookies)
Adds response cookie

Parameters:
connection - http connection
cookies - cookie

obtainCookieHeaders

protected static Map<String,String> obtainCookieHeaders(MultiStringMap responseHeaders)
Obtains cookie headers

Parameters:
responseHeaders - response headers
Returns:
map of cookie headers

getRequestCookies

public static Map<String,Cookie> getRequestCookies(HTTPConnection connection)
Obtains request cookies as a map

Parameters:
connection - http connection
Returns:
request cookies as a map


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.