java.lang.Object
org.glassfish.grizzly.http.util.CookieParserUtils
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 voidUnescapes any double quotes in the given cookie value.static voidUnescapes any double quotes in the given cookie value.static voidUnescapes any double quotes in the given cookie value.static voidUnescapes any double quotes in the given cookie value.
-
Constructor Details
-
CookieParserUtils
public CookieParserUtils()
-
-
Method Details
-
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
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
-
unescapeDoubleQuotes
Unescapes any double quotes in the given cookie value.- Parameters:
dc- The cookie value to modify
-
unescapeDoubleQuotes
Unescapes any double quotes in the given cookie value.- Parameters:
bc- The cookie value to modify
-
unescapeDoubleQuotes
Unescapes any double quotes in the given cookie value.- Parameters:
bc- The cookie value to modify
-
unescapeDoubleQuotes
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
-
unescapeDoubleQuotes
Unescapes any double quotes in the given cookie value.- Parameters:
s- The cookie value to modify- Returns:
- new String
-