Class ServerCookie

java.lang.Object
com.hybris.yprofile.consent.cookie.ServerCookie
All Implemented Interfaces:
Serializable

public final class ServerCookie extends Object implements Serializable
Stripped out org.apache.tomcat.util.http.ServerCookie for use of #appendCookieValue(StringBuffer, int, String, String, String, String, String, int, boolean, boolean)
See Also:
  • Method Details

    • appendCookieValue

      public static void appendCookieValue(StringBuffer headerBuf, int version, String name, String value, String path, String domain, String comment, int maxAge, boolean isSecure, boolean isHttpOnly)
    • addMaxAgeInfo

      protected static void addMaxAgeInfo(int maxAge, StringBuffer buf, int newVersion)
    • addVersionAndDomainInfo

      protected static void addVersionAndDomainInfo(String value, String domain, String comment, StringBuffer buf, int newVersion)
    • getNewVersionBeforeCookieHeader

      protected static int getNewVersionBeforeCookieHeader(String value, String path, String domain, String comment, int version)
    • getNewVersionFromTokenInPathOrDomain

      protected static int getNewVersionFromTokenInPathOrDomain(String path, String domain, int version)
    • hasCookieSupport

      protected static boolean hasCookieSupport(String value)
    • getNewVersionFromTokenInValueOrComment

      protected static int getNewVersionFromTokenInValueOrComment(String value, String comment, int version)
    • maybeQuote

      protected static void maybeQuote(StringBuffer buf, String value)
      Quotes values if required.
      Parameters:
      buf -
      value -
    • escapeDoubleQuotes

      protected static String escapeDoubleQuotes(String s, int beginIndex, int endIndex)
      Escapes any double quotes in the given string.
      Parameters:
      s - the input string
      beginIndex - start index inclusive
      endIndex - exclusive
      Returns:
      The (possibly) escaped string
    • modifyDoubleQuotesChar

      protected static boolean modifyDoubleQuotesChar(String processedString, int endIndex, StringBuilder result, int stringIndex, char charString)
      This method is modifying result param due to charString value. If "\\", then we add this character to result and add next char if this was not the end of passed string. If charString '"', then escape it with \\. All other will just append charString param.
      Returns:
      true when '\\' was present in the string, otherwise false