net.groboclown.util.http.v1
Class Rfc2109CookieParser

java.lang.Object
  |
  +--net.groboclown.util.http.v1.NetscapeCookieParser
        |
        +--net.groboclown.util.http.v1.Rfc2109CookieParser
All Implemented Interfaces:
IHttpClientStateParser

public class Rfc2109CookieParser
extends NetscapeCookieParser

Parses cookies to and from the HTTP messages, but only using the RFC 2109 format. The acceptance crieteria is if "Version" information is given in the cookie.

Future consideration: optimise the parseCookieNameValue in an OO way: create a base class which performs an action on the given Cookie object, and store these in a HashMap/Hashtable for faster processing.

Since:
Alpha 0.9.1
Version:
Alpha 0.9.1
Author:
Matt Albrecht

Inner classes inherited from class net.groboclown.util.http.v1.NetscapeCookieParser
NetscapeCookieParser.ICookieValueParser, NetscapeCookieParser.NameValuePair
 
Field Summary
private static Hashtable RFC2109_COOKIE_VALUE_PARSERS
           
 
Fields inherited from class net.groboclown.util.http.v1.NetscapeCookieParser
NETSCAPE_COOKIE_VALUE_PARSERS, SET_COOKIE_NAME
 
Constructor Summary
Rfc2109CookieParser()
           
 
Method Summary
(package private) static void ()
           
protected  IHttpClientState[] abortWithCookies(Cookie finishedCookie, String header)
           
protected  NetscapeCookieParser.NameValuePair[] divideLineIntoNameValuePairs(String header)
          Split up the header into name-value pairs.
protected  NetscapeCookieParser.ICookieValueParser getCookieValueParser(NetscapeCookieParser.NameValuePair pair)
           
 
Methods inherited from class net.groboclown.util.http.v1.NetscapeCookieParser
makeString, parseClientStateHeaders, parseHeader, parseHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

RFC2109_COOKIE_VALUE_PARSERS

private static final Hashtable RFC2109_COOKIE_VALUE_PARSERS
Constructor Detail

Rfc2109CookieParser

public Rfc2109CookieParser()
Method Detail

static void ()

divideLineIntoNameValuePairs

protected NetscapeCookieParser.NameValuePair[] divideLineIntoNameValuePairs(String header)
Split up the header into name-value pairs. This includes Quote parsing (allowing ';' and ',' characters inside the quotes).

Currently, extra data between the last quote character of a value string and the next separator character is ignored.

Overrides:
divideLineIntoNameValuePairs in class NetscapeCookieParser

getCookieValueParser

protected NetscapeCookieParser.ICookieValueParser getCookieValueParser(NetscapeCookieParser.NameValuePair pair)
Overrides:
getCookieValueParser in class NetscapeCookieParser

abortWithCookies

protected IHttpClientState[] abortWithCookies(Cookie finishedCookie,
                                              String header)
Overrides:
abortWithCookies in class NetscapeCookieParser


Written under the LGPL