com.noelios.restlet.util
Class CookieUtils

java.lang.Object
  extended by com.noelios.restlet.util.CookieUtils

public class CookieUtils
extends Object

Cookie manipulation utilities.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
CookieUtils()
           
 
Method Summary
static String format(Cookie cookie)
          Formats a cookie.
static void format(Cookie cookie, Appendable destination)
          Formats a cookie setting.
static String format(CookieSetting cookieSetting)
          Formats a cookie setting.
static void format(CookieSetting cookieSetting, Appendable destination)
          Formats a cookie setting.
static String format(List<Cookie> cookies)
          Formats a list of cookies as an HTTP header.
static void getCookies(List<Cookie> source, Map<String,Cookie> destination)
          Gets the cookies whose name is a key in the given map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieUtils

public CookieUtils()
Method Detail

format

public static String format(List<Cookie> cookies)
Formats a list of cookies as an HTTP header.

Parameters:
cookies - The list of cookies to format.
Returns:
The HTTP header.

format

public static String format(CookieSetting cookieSetting)
Formats a cookie setting.

Parameters:
cookieSetting - The cookie setting to format.
Returns:
The formatted cookie setting.

format

public static void format(CookieSetting cookieSetting,
                          Appendable destination)
                   throws IOException
Formats a cookie setting.

Parameters:
cookieSetting - The cookie setting to format.
destination - The appendable destination.
Throws:
IOException

format

public static String format(Cookie cookie)
Formats a cookie.

Parameters:
cookie - The cookie to format.
Returns:
The formatted cookie.

format

public static void format(Cookie cookie,
                          Appendable destination)
Formats a cookie setting.

Parameters:
cookie - The cookie to format.
destination - The appendable destination.

getCookies

public static void getCookies(List<Cookie> source,
                              Map<String,Cookie> destination)
Gets the cookies whose name is a key in the given map. If a matching cookie is found, its value is put in the map.

Parameters:
source - The source list of cookies.
destination - The cookies map controlling the reading.


Copyright © 2005-2007 Noelios Technologies.