Package org.apache.http.impl.client
Class BasicCookieStore
java.lang.Object
org.apache.http.impl.client.BasicCookieStore
- All Implemented Interfaces:
Serializable
,CookieStore
@Contract(threading=SAFE)
public class BasicCookieStore
extends Object
implements CookieStore, Serializable
Default implementation of
CookieStore
- Since:
- 4.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds anHTTP cookie
, replacing any existing equivalent cookies.void
addCookies
(Cookie[] cookies) Adds an array ofHTTP cookies
.void
clear()
Clears all cookies.boolean
clearExpired
(Date date) Returns an immutable array ofcookies
that this HTTP state currently contains.toString()
-
Constructor Details
-
BasicCookieStore
public BasicCookieStore()
-
-
Method Details
-
addCookie
Adds anHTTP 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 interfaceCookieStore
- Parameters:
cookie
- thecookie
to be added- See Also:
-
addCookies
Adds an array ofHTTP 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
- thecookies
to be added- See Also:
-
getCookies
Returns an immutable array ofcookies
that this HTTP state currently contains.- Specified by:
getCookies
in interfaceCookieStore
- Returns:
- an array of
cookies
.
-
clearExpired
- Specified by:
clearExpired
in interfaceCookieStore
- Returns:
- true if any cookies were purged.
- See Also:
-
clear
public void clear()Clears all cookies.- Specified by:
clear
in interfaceCookieStore
-
toString
-