Package org.glassfish.grizzly.http.util
Class CookieParserUtils
- java.lang.Object
-
- org.glassfish.grizzly.http.util.CookieParserUtils
-
public class CookieParserUtils extends Object
The set of Cookie utility methods for cookie parsing. There is duplication of logic within which we know to be frowned upon, however it is done with performance in mind.- Author:
- Grizzly team
-
-
Constructor Summary
Constructors Constructor Description CookieParserUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidparseClientCookies(Cookies cookies, byte[] bytes, int off, int len)Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVKstatic voidparseClientCookies(Cookies cookies, byte[] bytes, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVKstatic voidparseClientCookies(Cookies cookies, String cookiesStr, boolean versionOneStrictCompliance, boolean rfc6265Enabled)Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVKstatic voidparseClientCookies(Cookies cookies, org.glassfish.grizzly.Buffer buffer, int off, int len)Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVKstatic voidparseClientCookies(Cookies cookies, org.glassfish.grizzly.Buffer buffer, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVKstatic voidparseServerCookies(Cookies cookies, byte[] bytes, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)static voidparseServerCookies(Cookies cookies, String cookiesStr, boolean versionOneStrictCompliance, boolean rfc6265Enabled)static voidparseServerCookies(Cookies cookies, org.glassfish.grizzly.Buffer buffer, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)static StringunescapeDoubleQuotes(String s, int start, int length)Unescapes any double quotes in the given cookie value.static intunescapeDoubleQuotes(org.glassfish.grizzly.Buffer buffer, int start, int length)Un-escapes any double quotes in the given cookie value.static voidunescapeDoubleQuotes(BufferChunk bc)Unescapes any double quotes in the given cookie value.static voidunescapeDoubleQuotes(ByteChunk bc)Unescapes any double quotes in the given cookie value.static voidunescapeDoubleQuotes(CharChunk cc)Unescapes any double quotes in the given cookie value.static voidunescapeDoubleQuotes(DataChunk dc)Unescapes any double quotes in the given cookie value.
-
-
-
Method Detail
-
parseClientCookies
public static void parseClientCookies(Cookies cookies, org.glassfish.grizzly.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(Cookies cookies, org.glassfish.grizzly.Buffer buffer, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
-
parseClientCookies
public static void parseClientCookies(Cookies cookies, byte[] bytes, 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(Cookies cookies, byte[] bytes, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
-
parseClientCookies
public static void parseClientCookies(Cookies cookies, String cookiesStr, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
-
parseServerCookies
public static void parseServerCookies(Cookies cookies, byte[] bytes, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
-
parseServerCookies
public static void parseServerCookies(Cookies cookies, org.glassfish.grizzly.Buffer buffer, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
-
parseServerCookies
public static void parseServerCookies(Cookies cookies, String cookiesStr, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
-
unescapeDoubleQuotes
public static void unescapeDoubleQuotes(DataChunk dc)
Unescapes any double quotes in the given cookie value.- Parameters:
dc- The cookie value to modify
-
unescapeDoubleQuotes
public static void unescapeDoubleQuotes(ByteChunk bc)
Unescapes any double quotes in the given cookie value.- Parameters:
bc- The cookie value to modify
-
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 void unescapeDoubleQuotes(CharChunk cc)
Unescapes any double quotes in the given cookie value.- Parameters:
cc- The cookie value to modify
-
unescapeDoubleQuotes
public static int unescapeDoubleQuotes(org.glassfish.grizzly.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
-
-