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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    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
    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
    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
    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
    static void
    parseServerCookies(Cookies cookies, byte[] bytes, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
     
    static void
    parseServerCookies(Cookies cookies, String cookiesStr, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
     
    static void
    parseServerCookies(Cookies cookies, org.glassfish.grizzly.Buffer buffer, int off, int len, boolean versionOneStrictCompliance, boolean rfc6265Enabled)
     
    static String
    unescapeDoubleQuotes(String s, int start, int length)
    Unescapes any double quotes in the given cookie value.
    static int
    unescapeDoubleQuotes(org.glassfish.grizzly.Buffer buffer, int start, int length)
    Un-escapes any double quotes in the given cookie value.
    static void
    Unescapes any double quotes in the given cookie value.
    static void
    Unescapes any double quotes in the given cookie value.
    static void
    Unescapes any double quotes in the given cookie value.
    static void
    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 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

      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
    • 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