net.groboclown.util.http.v1
Class NetscapeCookieParser
java.lang.Object
|
+--net.groboclown.util.http.v1.NetscapeCookieParser
- All Implemented Interfaces:
- IHttpClientStateParser
- Direct Known Subclasses:
- Rfc2109CookieParser
- public class NetscapeCookieParser
- extends Object
- implements IHttpClientStateParser
Parses cookies to and from the HTTP messages. Only parses out the
Netscape values. The specification is archived at
The
Netscape Cookie Specification.
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
SET_COOKIE_NAME
private static final String SET_COOKIE_NAME
NETSCAPE_COOKIE_VALUE_PARSERS
private static final Hashtable NETSCAPE_COOKIE_VALUE_PARSERS
NetscapeCookieParser
public NetscapeCookieParser()
static void ()
parseClientStateHeaders
public IHttpClientState[] parseClientStateHeaders(IHttpResponseMessage msg)
- Return the list of cookies that are contained in the
headers for the message. If none of them are supported, returns
null. This needs to be thread safe.
- Specified by:
parseClientStateHeaders
in interface IHttpClientStateParser
parseHeaders
public IHttpClientState[] parseHeaders(String[] cookies)
- Return the list of cookies that are contained in the given
header values. This needs to be thread safe.
parseHeader
public IHttpClientState[] parseHeader(String header)
divideLineIntoNameValuePairs
protected NetscapeCookieParser.NameValuePair[] divideLineIntoNameValuePairs(String header)
- Split up the header into name-value pairs.
getCookieValueParser
protected NetscapeCookieParser.ICookieValueParser getCookieValueParser(NetscapeCookieParser.NameValuePair pair)
abortWithCookies
protected IHttpClientState[] abortWithCookies(Cookie finishedCookie,
String header)
makeString
protected String makeString(char[] buff,
int startPos,
int endPos)
Written under the LGPL