Package org.apache.http.impl.cookie
Class BasicClientCookie2
- java.lang.Object
 - 
- org.apache.http.impl.cookie.BasicClientCookie
 - 
- org.apache.http.impl.cookie.BasicClientCookie2
 
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,java.lang.Cloneable,ClientCookie,Cookie,SetCookie,SetCookie2
public class BasicClientCookie2 extends BasicClientCookie implements SetCookie2
Default implementation ofSetCookie2.- Since:
 - 4.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
- 
Fields inherited from interface org.apache.http.cookie.ClientCookie
COMMENT_ATTR, COMMENTURL_ATTR, DISCARD_ATTR, DOMAIN_ATTR, EXPIRES_ATTR, MAX_AGE_ATTR, PATH_ATTR, PORT_ATTR, SECURE_ATTR, VERSION_ATTR 
 - 
 
- 
Constructor Summary
Constructors Constructor Description BasicClientCookie2(java.lang.String name, java.lang.String value)Default Constructor taking a name and a value. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()java.lang.StringgetCommentURL()Returns null.int[]getPorts()Returns null.booleanisExpired(java.util.Date date)Returns true if this cookie has expired.booleanisPersistent()Returnsfalseif the cookie should be discarded at the end of the "session";trueotherwise.voidsetCommentURL(java.lang.String commentURL)If a user agent (web browser) presents this cookie to a user, the cookie's purpose will be described by the information at this URL.voidsetDiscard(boolean discard)Set the Discard attribute.voidsetPorts(int[] ports)Sets the Port attribute.- 
Methods inherited from class org.apache.http.impl.cookie.BasicClientCookie
containsAttribute, getAttribute, getComment, getCreationDate, getDomain, getExpiryDate, getName, getPath, getValue, getVersion, isSecure, removeAttribute, setAttribute, setComment, setCreationDate, setDomain, setExpiryDate, setPath, setSecure, setValue, setVersion, toString 
- 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface org.apache.http.cookie.Cookie
getComment, getDomain, getExpiryDate, getName, getPath, getValue, getVersion, isSecure 
- 
Methods inherited from interface org.apache.http.cookie.SetCookie
setComment, setDomain, setExpiryDate, setPath, setSecure, setValue, setVersion 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getPorts
public int[] getPorts()
Description copied from class:BasicClientCookieReturns null. Cookies prior to RFC2965 do not set this attribute- Specified by:
 getPortsin interfaceCookie- Overrides:
 getPortsin classBasicClientCookie
 
- 
setPorts
public void setPorts(int[] ports)
Description copied from interface:SetCookie2Sets the Port attribute. It restricts the ports to which a cookie may be returned in a Cookie request header.- Specified by:
 setPortsin interfaceSetCookie2
 
- 
getCommentURL
public java.lang.String getCommentURL()
Description copied from class:BasicClientCookieReturns null. Cookies prior to RFC2965 do not set this attribute- Specified by:
 getCommentURLin interfaceCookie- Overrides:
 getCommentURLin classBasicClientCookie
 
- 
setCommentURL
public void setCommentURL(java.lang.String commentURL)
Description copied from interface:SetCookie2If a user agent (web browser) presents this cookie to a user, the cookie's purpose will be described by the information at this URL.- Specified by:
 setCommentURLin interfaceSetCookie2
 
- 
setDiscard
public void setDiscard(boolean discard)
Description copied from interface:SetCookie2Set the Discard attribute. Note:Discardattribute overridesMax-age.- Specified by:
 setDiscardin interfaceSetCookie2- See Also:
 Cookie.isPersistent()
 
- 
isPersistent
public boolean isPersistent()
Description copied from class:BasicClientCookieReturnsfalseif the cookie should be discarded at the end of the "session";trueotherwise.- Specified by:
 isPersistentin interfaceCookie- Overrides:
 isPersistentin classBasicClientCookie- Returns:
 falseif the cookie should be discarded at the end of the "session";trueotherwise
 
- 
isExpired
public boolean isExpired(java.util.Date date)
Description copied from class:BasicClientCookieReturns true if this cookie has expired.- Specified by:
 isExpiredin interfaceCookie- Overrides:
 isExpiredin classBasicClientCookie- Parameters:
 date- Current time- Returns:
 trueif the cookie has expired.
 
- 
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
 clonein classBasicClientCookie- Throws:
 java.lang.CloneNotSupportedException
 
 - 
 
 -