Top Description Fields Constructors Methods
org.glassfish.grizzly.http.util

public final Class CookieUtils

extends Object
Class Inheritance
Imports
java.time.Instant, .ZoneId, java.time.format.DateTimeFormatter, java.util.Locale, org.glassfish.grizzly.Buffer

The general set of Cookie utility methods.
Author
Grizzly team

Field Summary

Modifier and TypeField and Description
public static final boolean
ALWAYS_ADD_EXPIRES

If set to false, we don't use the IE6/7 Max-Age/Expires work around

pack-priv static final String
public static final boolean
pack-priv static final char[]
pack-priv static final boolean[]
pack-priv static final String
pack-priv static final String
pack-priv static final String
public static final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean
containsCTL(String value, int version)

public static boolean
equals(String s, byte[] b, int start, int end)

public static boolean
equals(String s, Buffer b, int start, int end)

public static boolean
equals(String s1, String s2, int start, int end)

public static boolean
equalsIgnoreCase(String s, Buffer b, int start, int end)

public static boolean
equalsIgnoreCase(String s, byte[] b, int start, int end)

public static boolean
equalsIgnoreCase(String s1, String s2, int start, int end)

public static int
getQuotedValueEndPosition(Buffer buffer, int off, int end)

Given a starting position after an initial quote character, this gets the position of the end quote.

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.

public static int
getQuotedValueEndPosition(String s, int off, int end)

Given a starting position after an initial quote character, this gets the position of the end quote.

public static int
getTokenEndPosition(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.

public static int
getTokenEndPosition(Buffer buffer, int off, int end, boolean parseAsVersion1)

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.

public static int
getTokenEndPosition(byte[] bytes, int off, int end, boolean parseAsVersion1)

public static int
getTokenEndPosition(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.

public static int
getTokenEndPosition(String s, int off, int end, boolean parseAsVersion1)

public static boolean
isSeparator(final int c)

Returns true if the byte is a separator character as defined in RFC2619.

public static boolean
isSeparator(final int c, final boolean parseAsVersion1)

public static boolean
isToken(String value)

public static boolean
isToken(String value, String literals)

public static boolean
public static boolean
isToken2(String value, String literals)

public static boolean
isWhiteSpace(final int c)

Returns true if the byte is a whitespace character as defined in RFC2619.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALWAYS_ADD_EXPIRESback to summary
public static final boolean ALWAYS_ADD_EXPIRES

If set to false, we don't use the IE6/7 Max-Age/Expires work around

ancientDateback to summary
pack-priv static final String ancientDate
RFC_6265_SUPPORT_ENABLEDback to summary
public static final boolean RFC_6265_SUPPORT_ENABLED
SEPARATORSback to summary
pack-priv static final char[] SEPARATORS
separatorsback to summary
pack-priv static final boolean[] separators
tspecialsback to summary
pack-priv static final String tspecials
tspecials2back to summary
pack-priv static final String tspecials2
tspecials2NoSlashback to summary
pack-priv static final String tspecials2NoSlash
USE_LEGACY_PARSERback to summary
public static final boolean USE_LEGACY_PARSER

Constructor Detail

CookieUtilsback to summary
public CookieUtils()

Method Detail

containsCTLback to summary
public static boolean containsCTL(String value, int version)
equalsback to summary
public static boolean equals(String s, byte[] b, int start, int end)
equalsback to summary
public static boolean equals(String s, Buffer b, int start, int end)
equalsback to summary
public static boolean equals(String s1, String s2, int start, int end)
equalsIgnoreCaseback to summary
public static boolean equalsIgnoreCase(String s, Buffer b, int start, int end)
equalsIgnoreCaseback to summary
public static boolean equalsIgnoreCase(String s, byte[] b, int start, int end)
equalsIgnoreCaseback to summary
public static boolean equalsIgnoreCase(String s1, String s2, int start, int end)
getQuotedValueEndPositionback to summary
public static int getQuotedValueEndPosition(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

getQuotedValueEndPositionback to summary
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

getQuotedValueEndPositionback to summary
public static int getQuotedValueEndPosition(String s, 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

getTokenEndPositionback to summary
public static int getTokenEndPosition(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

getTokenEndPositionback to summary
public static int getTokenEndPosition(Buffer buffer, int off, int end, boolean parseAsVersion1)
getTokenEndPositionback to summary
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

getTokenEndPositionback to summary
public static int getTokenEndPosition(byte[] bytes, int off, int end, boolean parseAsVersion1)
getTokenEndPositionback to summary
public static int getTokenEndPosition(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. JVK

getTokenEndPositionback to summary
public static int getTokenEndPosition(String s, int off, int end, boolean parseAsVersion1)
isSeparatorback to summary
public static boolean isSeparator(final 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.

isSeparatorback to summary
public static boolean isSeparator(final int c, final boolean parseAsVersion1)
isTokenback to summary
public static boolean isToken(String value)
isTokenback to summary
public static boolean isToken(String value, String literals)
isToken2back to summary
public static boolean isToken2(String value)
isToken2back to summary
public static boolean isToken2(String value, String literals)
isWhiteSpaceback to summary
public static boolean isWhiteSpace(final int c)

Returns true if the byte is a whitespace character as defined in RFC2619.