org.norther.tammi.spray.protocol.chain
Class CookieParser

java.lang.Object
  extended by org.norther.tammi.spray.protocol.chain.CookieParser

public abstract class CookieParser
extends Object

A static HTTP cookie header parser.

Author:
Ilkka Priha

Field Summary
static String COOKIE
          Request headers.
static String SET_COOKIE
          Response headers.
 
Constructor Summary
CookieParser()
           
 
Method Summary
static Cookie getSessionCookie(String id, String path, boolean secure)
          Gets a session cookie.
static List parseCookies(Enumeration headers)
          Parses cookies from headers.
static int parseCookies(Enumeration headers, List list)
          Parses cookies from headers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COOKIE

public static final String COOKIE
Request headers.

See Also:
Constant Field Values

SET_COOKIE

public static final String SET_COOKIE
Response headers.

See Also:
Constant Field Values
Constructor Detail

CookieParser

public CookieParser()
Method Detail

parseCookies

public static final List parseCookies(Enumeration headers)
Parses cookies from headers.

Parameters:
headers - an enumeration of header values.
Returns:
a list of cookies.
Throws:
IllegalArgumentException - for parsing errors.

parseCookies

public static final int parseCookies(Enumeration headers,
                                     List list)
Parses cookies from headers.

Parameters:
headers - an enumeration of header values.
list - a list for results.
Returns:
the number of parsed cookies.
Throws:
IllegalArgumentException - for parsing errors.

getSessionCookie

public static Cookie getSessionCookie(String id,
                                      String path,
                                      boolean secure)
Gets a session cookie.

Parameters:
id - the session id.
path - the context path.
secure - the secure flag.
Returns:
the session cookie.


Copyright © 2004 The Norther Organization. All rights reserved.