org.glassfish.grizzly.http.util
Class CookieParserUtils

java.lang.Object
  extended by org.glassfish.grizzly.http.util.CookieParserUtils

public class CookieParserUtils
extends Object

The set of Cookie utility methods for cookie parsing.

Author:
Grizzly team

Constructor Summary
CookieParserUtils()
           
 
Method Summary
static void parseClientCookies(Collection<Cookie> cookies, Buffer buffer, int off, int len)
          Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
static void parseClientCookies(Collection<Cookie> cookies, Buffer buffer, int off, int len, boolean versionOneStrictCompliance)
          Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
static void parseClientCookies(Collection<Cookie> cookies, String cookiesStr, boolean versionOneStrictCompliance)
          Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
static void parseServerCookies(Collection<Cookie> cookies, Buffer buffer, int off, int len, boolean versionOneStrictCompliance)
           
static void parseServerCookies(Collection<Cookie> cookies, String cookiesStr, boolean versionOneStrictCompliance)
           
static void unescapeDoubleQuotes(BufferChunk bc)
          Unescapes any double quotes in the given cookie value.
static int unescapeDoubleQuotes(Buffer buffer, int start, int length)
          Un-escapes any double quotes in the given cookie value.
static String unescapeDoubleQuotes(String s, int start, int length)
          Unescapes any double quotes in the given cookie value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieParserUtils

public CookieParserUtils()
Method Detail

parseClientCookies

public static void parseClientCookies(Collection<Cookie> cookies,
                                      Buffer buffer,
                                      int off,
                                      int len)
Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK


parseClientCookies

public static void parseClientCookies(Collection<Cookie> cookies,
                                      Buffer buffer,
                                      int off,
                                      int len,
                                      boolean versionOneStrictCompliance)
Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK


parseClientCookies

public static void parseClientCookies(Collection<Cookie> cookies,
                                      String cookiesStr,
                                      boolean versionOneStrictCompliance)
Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK


parseServerCookies

public static void parseServerCookies(Collection<Cookie> cookies,
                                      Buffer buffer,
                                      int off,
                                      int len,
                                      boolean versionOneStrictCompliance)

parseServerCookies

public static void parseServerCookies(Collection<Cookie> cookies,
                                      String cookiesStr,
                                      boolean versionOneStrictCompliance)

unescapeDoubleQuotes

public static void unescapeDoubleQuotes(BufferChunk bc)
Unescapes any double quotes in the given cookie value.

Parameters:
bc - The cookie value to modify

unescapeDoubleQuotes

public static int unescapeDoubleQuotes(Buffer buffer,
                                       int start,
                                       int length)
Un-escapes any double quotes in the given cookie value.

Parameters:
buffer - the cookie buffer.
start - start position.
length - number of bytes to un-escape.
Returns:
new length

unescapeDoubleQuotes

public static String unescapeDoubleQuotes(String s,
                                          int start,
                                          int length)
Unescapes any double quotes in the given cookie value.

Parameters:
s - The cookie value to modify
Returns:
new String


Copyright © 2010 Oracle Corpration. All Rights Reserved.