Class ServerCookie
java.lang.Object
com.hybris.yprofile.consent.cookie.ServerCookie
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddMaxAgeInfo(int maxAge, StringBuffer buf, int newVersion) protected static voidaddVersionAndDomainInfo(String value, String domain, String comment, StringBuffer buf, int newVersion) static voidappendCookieValue(StringBuffer headerBuf, int version, String name, String value, String path, String domain, String comment, int maxAge, boolean isSecure, boolean isHttpOnly) protected static StringescapeDoubleQuotes(String s, int beginIndex, int endIndex) Escapes any double quotes in the given string.protected static intgetNewVersionBeforeCookieHeader(String value, String path, String domain, String comment, int version) protected static intgetNewVersionFromTokenInPathOrDomain(String path, String domain, int version) protected static intgetNewVersionFromTokenInValueOrComment(String value, String comment, int version) protected static booleanhasCookieSupport(String value) protected static voidmaybeQuote(StringBuffer buf, String value) Quotes values if required.protected static booleanmodifyDoubleQuotesChar(String processedString, int endIndex, StringBuilder result, int stringIndex, char charString) This method is modifying result param due to charString value.
-
Method Details
-
appendCookieValue
-
addMaxAgeInfo
-
addVersionAndDomainInfo
protected static void addVersionAndDomainInfo(String value, String domain, String comment, StringBuffer buf, int newVersion) -
getNewVersionBeforeCookieHeader
-
getNewVersionFromTokenInPathOrDomain
-
hasCookieSupport
-
getNewVersionFromTokenInValueOrComment
-
maybeQuote
Quotes values if required.- Parameters:
buf-value-
-
escapeDoubleQuotes
Escapes any double quotes in the given string.- Parameters:
s- the input stringbeginIndex- start index inclusiveendIndex- 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
-