Package org.apache.cxf.transport.http
Class Cookie
- java.lang.Object
-
- org.apache.cxf.transport.http.Cookie
-
public class Cookie extends Object
Container for HTTP cookies used to track session state.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDISCARD_ATTRIBUTEstatic StringMAX_AGE_ATTRIBUTEstatic StringPATH_ATTRIBUTE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetMaxAge()Get the max-age of this cookieStringgetName()Get the name of this cookieStringgetPath()Get the path of this cookieStringgetValue()Get the value of this cookieinthashCode()StringrequestCookieHeader()Convert a list of cookies into a string suitable for sending as a "Cookie:" headervoidsetMaxAge(int maxAge)Set the max-age of this cookie.voidsetPath(String path)Set the path of this cookievoidsetValue(String value)Change the value of this cookie
-
-
-
Field Detail
-
DISCARD_ATTRIBUTE
public static final String DISCARD_ATTRIBUTE
- See Also:
- Constant Field Values
-
MAX_AGE_ATTRIBUTE
public static final String MAX_AGE_ATTRIBUTE
- See Also:
- Constant Field Values
-
PATH_ATTRIBUTE
public static final String PATH_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
Get the name of this cookie- Returns:
- cookie name
-
setValue
public void setValue(String value)
Change the value of this cookie- Parameters:
value-
-
getValue
public String getValue()
Get the value of this cookie- Returns:
- cookie value
-
setPath
public void setPath(String path)
Set the path of this cookie- Parameters:
path-
-
getPath
public String getPath()
Get the path of this cookie- Returns:
- cookie path
-
setMaxAge
public void setMaxAge(int maxAge)
Set the max-age of this cookie. If set to 0, it should be removed from the session.- Parameters:
maxAge-
-
getMaxAge
public int getMaxAge()
Get the max-age of this cookie- Returns:
-
requestCookieHeader
public String requestCookieHeader()
Convert a list of cookies into a string suitable for sending as a "Cookie:" header- Returns:
- Cookie header text
-
-