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:
Serializable
,Cloneable
,ClientCookie
,Cookie
,SetCookie
,SetCookie2
Default implementation of
SetCookie2
.- Since:
- 4.0
- See Also:
-
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
ConstructorsConstructorDescriptionBasicClientCookie2
(String name, String value) Default Constructor taking a name and a value. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns null.int[]
getPorts()
Returns null.boolean
Returns true if this cookie has expired.boolean
Returnsfalse
if the cookie should be discarded at the end of the "session";true
otherwise.void
setCommentURL
(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.void
setDiscard
(boolean discard) Set the Discard attribute.void
setPorts
(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
-
Constructor Details
-
BasicClientCookie2
Default Constructor taking a name and a value. The value may be null.- Parameters:
name
- The name.value
- The value.
-
-
Method Details
-
getPorts
public int[] getPorts()Description copied from class:BasicClientCookie
Returns null. Cookies prior to RFC2965 do not set this attribute- Specified by:
getPorts
in interfaceCookie
- Overrides:
getPorts
in classBasicClientCookie
-
setPorts
public void setPorts(int[] ports) Description copied from interface:SetCookie2
Sets the Port attribute. It restricts the ports to which a cookie may be returned in a Cookie request header.- Specified by:
setPorts
in interfaceSetCookie2
-
getCommentURL
Description copied from class:BasicClientCookie
Returns null. Cookies prior to RFC2965 do not set this attribute- Specified by:
getCommentURL
in interfaceCookie
- Overrides:
getCommentURL
in classBasicClientCookie
-
setCommentURL
Description copied from interface:SetCookie2
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.- Specified by:
setCommentURL
in interfaceSetCookie2
-
setDiscard
public void setDiscard(boolean discard) Description copied from interface:SetCookie2
Set the Discard attribute. Note:Discard
attribute overridesMax-age
.- Specified by:
setDiscard
in interfaceSetCookie2
- See Also:
-
isPersistent
public boolean isPersistent()Description copied from class:BasicClientCookie
Returnsfalse
if the cookie should be discarded at the end of the "session";true
otherwise.- Specified by:
isPersistent
in interfaceCookie
- Overrides:
isPersistent
in classBasicClientCookie
- Returns:
false
if the cookie should be discarded at the end of the "session";true
otherwise
-
isExpired
Description copied from class:BasicClientCookie
Returns true if this cookie has expired.- Specified by:
isExpired
in interfaceCookie
- Overrides:
isExpired
in classBasicClientCookie
- Parameters:
date
- Current time- Returns:
true
if the cookie has expired.
-
clone
- Overrides:
clone
in classBasicClientCookie
- Throws:
CloneNotSupportedException
-