Methods Summary |
---|
public java.lang.Object | clone()
BasicClientCookie clone = (BasicClientCookie) super.clone();
clone.attribs = new HashMap<String, String>(this.attribs);
return clone;
|
public boolean | containsAttribute(java.lang.String name)
return this.attribs.get(name) != null;
|
public java.lang.String | getAttribute(java.lang.String name)
return this.attribs.get(name);
|
public java.lang.String | getComment()Returns the comment describing the purpose of this cookie, or
null if no such comment has been defined.
return cookieComment;
|
public java.lang.String | getCommentURL()Returns null. Cookies prior to RFC2965 do not set this attribute
return null;
|
public java.lang.String | getDomain()Returns domain attribute of the cookie.
return cookieDomain;
|
public java.util.Date | getExpiryDate()Returns the expiration {@link Date} of the cookie, or null
if none exists.
Note: the object returned by this method is
considered immutable. Changing it (e.g. using setTime()) could result
in undefined behaviour. Do so at your peril.
return cookieExpiryDate;
|
public java.lang.String | getName()Returns the name.
return this.name;
|
public java.lang.String | getPath()Returns the path attribute of the cookie
return cookiePath;
|
public int[] | getPorts()Returns null. Cookies prior to RFC2965 do not set this attribute
return null;
|
public java.lang.String | getValue()Returns the value.
return this.value;
|
public int | getVersion()Returns the version of the cookie specification to which this
cookie conforms.
return cookieVersion;
|
public boolean | isExpired(java.util.Date date)Returns true if this cookie has expired.
if (date == null) {
throw new IllegalArgumentException("Date may not be null");
}
return (cookieExpiryDate != null
&& cookieExpiryDate.getTime() <= date.getTime());
|
public boolean | isPersistent()Returns false if the cookie should be discarded at the end
of the "session"; true otherwise.
return (null != cookieExpiryDate);
|
public boolean | isSecure()
return isSecure;
|
public void | setAttribute(java.lang.String name, java.lang.String value)
this.attribs.put(name, value);
|
public void | setComment(java.lang.String comment)If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described using this comment.
cookieComment = comment;
|
public void | setDomain(java.lang.String domain)Sets the domain attribute.
if (domain != null) {
cookieDomain = domain.toLowerCase(Locale.ENGLISH);
} else {
cookieDomain = null;
}
|
public void | setExpiryDate(java.util.Date expiryDate)Sets expiration date.
Note: the object returned by this method is considered
immutable. Changing it (e.g. using setTime()) could result in undefined
behaviour. Do so at your peril.
cookieExpiryDate = expiryDate;
|
public void | setPath(java.lang.String path)Sets the path attribute.
cookiePath = path;
|
public void | setSecure(boolean secure)Sets the secure attribute of the cookie.
When true the cookie should only be sent
using a secure protocol (https). This should only be set when
the cookie's originating server used a secure protocol to set the
cookie's value.
isSecure = secure;
|
public void | setValue(java.lang.String value)Sets the value
this.value = value;
|
public void | setVersion(int version)Sets the version of the cookie specification to which this
cookie conforms.
cookieVersion = version;
|
public java.lang.String | toString()
StringBuilder buffer = new StringBuilder();
buffer.append("[version: ");
buffer.append(Integer.toString(this.cookieVersion));
buffer.append("]");
buffer.append("[name: ");
buffer.append(this.name);
buffer.append("]");
buffer.append("[value: ");
buffer.append(this.value);
buffer.append("]");
buffer.append("[domain: ");
buffer.append(this.cookieDomain);
buffer.append("]");
buffer.append("[path: ");
buffer.append(this.cookiePath);
buffer.append("]");
buffer.append("[expiry: ");
buffer.append(this.cookieExpiryDate);
buffer.append("]");
return buffer.toString();
|