org.apache.http.impl.client
Class BasicCookieStoreHC4

java.lang.Object
  extended by org.apache.http.impl.client.BasicCookieStoreHC4
All Implemented Interfaces:
java.io.Serializable, org.apache.http.client.CookieStore

@ThreadSafe
public class BasicCookieStoreHC4
extends java.lang.Object
implements org.apache.http.client.CookieStore, java.io.Serializable

Default implementation of CookieStore

Since:
4.0
See Also:
Serialized Form

Constructor Summary
BasicCookieStoreHC4()
           
 
Method Summary
 void addCookie(org.apache.http.cookie.Cookie cookie)
          Adds an HTTP cookie, replacing any existing equivalent cookies.
 void addCookies(org.apache.http.cookie.Cookie[] cookies)
          Adds an array of HTTP cookies.
 void clear()
          Clears all cookies.
 boolean clearExpired(java.util.Date date)
          Removes all of cookies in this HTTP state that have expired by the specified date.
 java.util.List<org.apache.http.cookie.Cookie> getCookies()
          Returns an immutable array of cookies that this HTTP state currently contains.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicCookieStoreHC4

public BasicCookieStoreHC4()
Method Detail

addCookie

public void addCookie(org.apache.http.cookie.Cookie cookie)
Adds an HTTP cookie, replacing any existing equivalent cookies. If the given cookie has already expired it will not be added, but existing values will still be removed.

Specified by:
addCookie in interface org.apache.http.client.CookieStore
Parameters:
cookie - the cookie to be added
See Also:
addCookies(Cookie[])

addCookies

public void addCookies(org.apache.http.cookie.Cookie[] cookies)
Adds an array of HTTP cookies. Cookies are added individually and in the given array order. If any of the given cookies has already expired it will not be added, but existing values will still be removed.

Parameters:
cookies - the cookies to be added
See Also:
addCookie(Cookie)

getCookies

public java.util.List<org.apache.http.cookie.Cookie> getCookies()
Returns an immutable array of cookies that this HTTP state currently contains.

Specified by:
getCookies in interface org.apache.http.client.CookieStore
Returns:
an array of cookies.

clearExpired

public boolean clearExpired(java.util.Date date)
Removes all of cookies in this HTTP state that have expired by the specified date.

Specified by:
clearExpired in interface org.apache.http.client.CookieStore
Returns:
true if any cookies were purged.
See Also:
Cookie.isExpired(Date)

clear

public void clear()
Clears all cookies.

Specified by:
clear in interface org.apache.http.client.CookieStore

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object