Package edu.indiana.lib.twinpeaks.util
Class CookieData
- java.lang.Object
-
- edu.indiana.lib.twinpeaks.util.CookieData
-
public class CookieData extends Object
Represent a single cookie
-
-
Field Summary
Fields Modifier and Type Field Description static intEXPIRED_AGEExpired cookiestatic intNULL_AGENull (unset) cookie age
-
Constructor Summary
Constructors Constructor Description CookieData(URL url, String key, String value)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(CookieData cookie)Equal cookies?StringgetDomain()Get the domainStringgetExpires()Get the expiration dateintgetMaxAge()Get the maximum age for this cookieStringgetName()Get cookie nameStringgetPath()Get the pathbooleangetSecure()StringgetValue()Get cookie value (the cookie "text")StringgetVersion()Get the cookie versionvoidsetDomain(String domain)Save the domainvoidsetExpires(String expires)Save the expiration datevoidsetMaxAge(String maxAge)Set the maximum age for this cookievoidsetPath(String path)Save the pathvoidsetSecure(boolean secure)Save security setting (true if cookie to be sent only via HTTPS)voidsetVersion(String version)Save the version
-
-
-
Field Detail
-
NULL_AGE
public static final int NULL_AGE
Null (unset) cookie age- See Also:
- Constant Field Values
-
EXPIRED_AGE
public static final int EXPIRED_AGE
Expired cookie- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
Get cookie name- Returns:
- The cooke name
-
getValue
public String getValue()
Get cookie value (the cookie "text")- Returns:
- The value
-
setPath
public void setPath(String path)
Save the path
-
getPath
public String getPath()
Get the path- Returns:
- The cooke path attribute value (null if none)
-
setExpires
public void setExpires(String expires)
Save the expiration date
-
getExpires
public String getExpires()
Get the expiration date- Returns:
- The expires attribute value (null if none)
-
setDomain
public void setDomain(String domain)
Save the domain
-
getDomain
public String getDomain()
Get the domain- Returns:
- The domain attribute value (null if none)
-
setVersion
public void setVersion(String version)
Save the version
-
getVersion
public String getVersion()
Get the cookie version- Returns:
- The version (null if none)
-
setMaxAge
public void setMaxAge(String maxAge)
Set the maximum age for this cookie
-
getMaxAge
public int getMaxAge()
Get the maximum age for this cookie
-
setSecure
public void setSecure(boolean secure)
Save security setting (true if cookie to be sent only via HTTPS)
-
getSecure
public boolean getSecure()
-
equals
public boolean equals(CookieData cookie)
Equal cookies?- Parameters:
cookie- for comparison- Returns:
- true if cookie name, path, and domain are all equal
-
-