Package org.glassfish.grizzly.http.util
Class CookieHeaderGenerator
- java.lang.Object
-
- org.glassfish.grizzly.http.util.CookieHeaderGenerator
-
public class CookieHeaderGenerator extends Object
Cookie header generator based on RFC6265
- Author:
- The Tomcat team, Arjan Tijms
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringANCIENT_DATEstatic StringCOOKIE_COMMENT_ATTRprotected static ThreadLocal<DateFormat>COOKIE_DATE_FORMATstatic StringCOOKIE_DOMAIN_ATTRstatic StringCOOKIE_HTTP_ONLY_ATTRstatic StringCOOKIE_MAX_AGE_ATTRstatic StringCOOKIE_PATH_ATTRstatic StringCOOKIE_SECURE_ATTR
-
Constructor Summary
Constructors Constructor Description CookieHeaderGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgenerateHeader(String name, String value, int maxAge, String domain, String path, boolean isSecure, boolean isHttpOnly, Map<String,String> attributes)static booleanisToken(String string)Is the provided String a token as per RFC 7230?
Note: token = 1 * tchar (RFC 7230)
Since a token requires at least 1 tchar,nulland the empty string ("") are not considered to be valid tokens.
-
-
-
Field Detail
-
COOKIE_COMMENT_ATTR
public static final String COOKIE_COMMENT_ATTR
- See Also:
- Constant Field Values
-
COOKIE_DOMAIN_ATTR
public static final String COOKIE_DOMAIN_ATTR
- See Also:
- Constant Field Values
-
COOKIE_MAX_AGE_ATTR
public static final String COOKIE_MAX_AGE_ATTR
- See Also:
- Constant Field Values
-
COOKIE_PATH_ATTR
public static final String COOKIE_PATH_ATTR
- See Also:
- Constant Field Values
-
COOKIE_SECURE_ATTR
public static final String COOKIE_SECURE_ATTR
- See Also:
- Constant Field Values
-
COOKIE_HTTP_ONLY_ATTR
public static final String COOKIE_HTTP_ONLY_ATTR
- See Also:
- Constant Field Values
-
COOKIE_DATE_FORMAT
protected static final ThreadLocal<DateFormat> COOKIE_DATE_FORMAT
-
ANCIENT_DATE
protected static final String ANCIENT_DATE
-
-
Method Detail
-
generateHeader
public static String generateHeader(String name, String value, int maxAge, String domain, String path, boolean isSecure, boolean isHttpOnly, Map<String,String> attributes)
-
isToken
public static boolean isToken(String string)
Is the provided String a token as per RFC 7230?
Note: token = 1 * tchar (RFC 7230)
Since a token requires at least 1 tchar,nulland the empty string ("") are not considered to be valid tokens.- Parameters:
string- The string to test- Returns:
trueif the string is a valid token, otherwisefalse
-
-