Package com.meterware.httpunit.cookies
Class Cookie
- java.lang.Object
-
- com.meterware.httpunit.cookies.Cookie
-
public class Cookie extends java.lang.ObjectAn HTTP client-side cookie.- Author:
- Russell Gold
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetDomain()Returns the domain to which this cookie may be sent.longgetExpiredTime()java.lang.StringgetName()Returns the name of this cookie.java.lang.StringgetPath()Returns the path to which this cookie is restricted.java.lang.StringgetValue()Returns the value associated with this cookie.inthashCode()booleanisExpired()check whether the cookie is expiredbooleanmayBeSentTo(java.net.URL url)may this cookie be sent to the given url?voidsetValue(java.lang.String value)Sets the value associated with this cookie.
-
-
-
Method Detail
-
getExpiredTime
public long getExpiredTime()
- Returns:
- the _expiredTime in milliseconds
-
getName
public java.lang.String getName()
Returns the name of this cookie.
-
getValue
public java.lang.String getValue()
Returns the value associated with this cookie.
-
setValue
public void setValue(java.lang.String value)
Sets the value associated with this cookie.
-
getPath
public java.lang.String getPath()
Returns the path to which this cookie is restricted.
-
getDomain
public java.lang.String getDomain()
Returns the domain to which this cookie may be sent.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
isExpired
public boolean isExpired()
check whether the cookie is expired- Returns:
- true if the _expiredTime is higher than the current System time
-
mayBeSentTo
public boolean mayBeSentTo(java.net.URL url)
may this cookie be sent to the given url?- Parameters:
url- - the unform resource locator to check- Returns:
- true if the cookie is not expired and the path is accepted if a domain is set
-
-