Support for OkHttp. More...
Inherits CookieJar.
This class provides cookie support for the OkHttp HTTP framework with BBCustomInterceptor interceptor. The application can access cookies that are managed by the BlackBerry Dynamics Runtime via BBCookieJar API.
Note: It is required to call BBCustomInterceptor.setCookieJar to set BBCookieJar instead of OkHttpClient.Builder.cookieJar.
Application code can add additional cookies to HTTP requests by calling BBCookieJar.addCookie. The cookies from the HTTP responses are added to BBCookieJar by the runtime.
Although application code does not need to extend BBCookieJar, it can do so if it wishes to add cookies from CookieJar callbacks.
Public Member Functions | |
void | addCookie (Cookie cookie) |
Adds an HTTP cookie. More... | |
List< Cookie > | getCookies () |
Returns all cookies contained in this CookieJar. More... | |
boolean | clearExpired (Date date) |
Clears all expired cookies. More... | |
void | clear () |
Clears all cookies. More... | |
void addCookie | ( | Cookie | cookie | ) |
Adds an HTTP cookie, replacing any existing equivalent cookie. If the given cookie has already expired it will not be added, and also existing equivalent cookie will be removed.
cookie | to be added |
List<Cookie> getCookies | ( | ) |
Returns all persistent and session cookies contained in this CookieJar.
boolean clearExpired | ( | Date | date | ) |
Removes all of the cookies in this CookieJar that have expired by the specified java.util.Date
date.
true
if any cookies were purged. void clear | ( | ) |
Removes all cookies including persistent cookies from this CookieJar.