Interface CookieStore
-
- All Known Implementing Classes:
BasicCookieStore
public interface CookieStoreThis interface represents an abstract store forCookieobjects.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddCookie(Cookie cookie)Adds anCookie, replacing any existing equivalent cookies.voidclear()Clears all cookies.default booleanclearExpired(java.time.Instant date)Removes all ofCookies in this store that have expired by the specifiedInstant.booleanclearExpired(java.util.Date date)Deprecated.java.util.List<Cookie>getCookies()Returns all cookies contained in this store.
-
-
-
Method Detail
-
addCookie
void addCookie(Cookie cookie)
Adds anCookie, replacing any existing equivalent cookies. If the given cookie has already expired it will not be added, but existing values will still be removed.- Parameters:
cookie- thecookieto be added
-
getCookies
java.util.List<Cookie> getCookies()
Returns all cookies contained in this store.- Returns:
- all cookies
-
clearExpired
@Deprecated boolean clearExpired(java.util.Date date)
Deprecated.Removes all ofCookies in this store that have expired by the specifiedDate.- Returns:
- true if any cookies were purged.
-
clearExpired
default boolean clearExpired(java.time.Instant date)
Removes all ofCookies in this store that have expired by the specifiedInstant.- Returns:
- true if any cookies were purged.
-
clear
void clear()
Clears all cookies.
-
-