java.lang.Object
org.glassfish.grizzly.http.util.CookieUtils
The general set of Cookie utility methods.
- Author:
- Grizzly team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanIf set to false, we don't use the IE6/7 Max-Age/Expires work aroundstatic final booleanIf set to true, then it will double quote the value and update cookie version when there is special characters.static final ThreadLocal<SimpleDateFormat>static final booleanstatic final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsCTL(String value, int version) static booleanstatic booleanstatic booleanstatic booleanequalsIgnoreCase(String s, byte[] b, int start, int end) static booleanequalsIgnoreCase(String s1, String s2, int start, int end) static booleanequalsIgnoreCase(String s, org.glassfish.grizzly.Buffer b, int start, int end) static intgetQuotedValueEndPosition(byte[] bytes, int off, int end) Given a starting position after an initial quote character, this gets the position of the end quote.static intgetQuotedValueEndPosition(String s, int off, int end) Given a starting position after an initial quote character, this gets the position of the end quote.static intgetQuotedValueEndPosition(org.glassfish.grizzly.Buffer buffer, int off, int end) Given a starting position after an initial quote character, this gets the position of the end quote.static intgetTokenEndPosition(byte[] bytes, int off, int end) Given the starting position of a token, this gets the end of the token, with no separator characters in between.static intgetTokenEndPosition(byte[] bytes, int off, int end, boolean parseAsVersion1) static intgetTokenEndPosition(String s, int off, int end) Given the starting position of a token, this gets the end of the token, with no separator characters in between.static intgetTokenEndPosition(String s, int off, int end, boolean parseAsVersion1) static intgetTokenEndPosition(org.glassfish.grizzly.Buffer buffer, int off, int end) Given the starting position of a token, this gets the end of the token, with no separator characters in between.static intgetTokenEndPosition(org.glassfish.grizzly.Buffer buffer, int off, int end, boolean parseAsVersion1) static booleanisSeparator(int c) Returns true if the byte is a separator character as defined in RFC2619.static booleanisSeparator(int c, boolean parseAsVersion1) static booleanstatic booleanstatic booleanstatic booleanstatic booleanisWhiteSpace(int c) Returns true if the byte is a whitespace character as defined in RFC2619.
-
Field Details
-
COOKIE_VERSION_ONE_STRICT_COMPLIANCE
public static final boolean COOKIE_VERSION_ONE_STRICT_COMPLIANCEIf set to true, then it will double quote the value and update cookie version when there is special characters. Tomcat uses STRICT_SERVLET_COMPLIANCE, whereas this code uses COOKIE_VERSION_ONE_STRICT_COMPLIANCE, which unlike the Tomcat variant not only affects cookie generation, but also cookie parsing. By default, cookies are parsed as v0 cookies, in order to maintain backward compatibility with GlassFish v2.x -
RFC_6265_SUPPORT_ENABLED
public static final boolean RFC_6265_SUPPORT_ENABLED -
USE_LEGACY_PARSER
public static final boolean USE_LEGACY_PARSER -
ALWAYS_ADD_EXPIRES
public static final boolean ALWAYS_ADD_EXPIRESIf set to false, we don't use the IE6/7 Max-Age/Expires work around -
OLD_COOKIE_FORMAT
-
-
Constructor Details
-
CookieUtils
public CookieUtils()
-
-
Method Details
-
isToken
-
isToken
-
containsCTL
-
isToken2
-
isToken2
-
equals
-
equals
-
equals
-
equalsIgnoreCase
public static boolean equalsIgnoreCase(String s, org.glassfish.grizzly.Buffer b, int start, int end) -
equalsIgnoreCase
-
equalsIgnoreCase
-
isSeparator
public static boolean isSeparator(int c) Returns true if the byte is a separator character as defined in RFC2619. Since this is called often, this function should be organized with the most probable outcomes first. -
isSeparator
public static boolean isSeparator(int c, boolean parseAsVersion1) -
isWhiteSpace
public static boolean isWhiteSpace(int c) Returns true if the byte is a whitespace character as defined in RFC2619. -
getTokenEndPosition
public static int getTokenEndPosition(org.glassfish.grizzly.Buffer buffer, int off, int end) Given the starting position of a token, this gets the end of the token, with no separator characters in between. JVK -
getTokenEndPosition
public static int getTokenEndPosition(org.glassfish.grizzly.Buffer buffer, int off, int end, boolean parseAsVersion1) -
getTokenEndPosition
public static int getTokenEndPosition(byte[] bytes, int off, int end) Given the starting position of a token, this gets the end of the token, with no separator characters in between. JVK -
getTokenEndPosition
public static int getTokenEndPosition(byte[] bytes, int off, int end, boolean parseAsVersion1) -
getTokenEndPosition
Given the starting position of a token, this gets the end of the token, with no separator characters in between. JVK -
getTokenEndPosition
-
getQuotedValueEndPosition
public static int getQuotedValueEndPosition(org.glassfish.grizzly.Buffer buffer, int off, int end) Given a starting position after an initial quote character, this gets the position of the end quote. This escapes anything after a '\' char JVK RFC 2616 -
getQuotedValueEndPosition
public static int getQuotedValueEndPosition(byte[] bytes, int off, int end) Given a starting position after an initial quote character, this gets the position of the end quote. This escapes anything after a '\' char JVK RFC 2616 -
getQuotedValueEndPosition
Given a starting position after an initial quote character, this gets the position of the end quote. This escapes anything after a '\' char JVK RFC 2616
-