public class SessionCookieJar
extends java.lang.Object
implements okhttp3.CookieJar
Constructor and Description |
---|
SessionCookieJar() |
Modifier and Type | Method and Description |
---|---|
java.util.List<okhttp3.Cookie> |
getCookies(@NonNull okhttp3.HttpUrl url)
Returns the cookies for the provided URL.
|
java.util.List<okhttp3.Cookie> |
getCookies(@NonNull java.lang.String url)
Returns the cookies for the provided URL.
|
java.util.List<okhttp3.Cookie> |
loadForRequest(okhttp3.HttpUrl url)
Loads cookies from the jar for an HTTP request to the URL.
|
void |
removeCookie(okhttp3.HttpUrl url,
java.lang.String name)
Removes a cookie with the provided name from the URL.
|
void |
removeCookie(java.lang.String url,
java.lang.String name)
Removes a cookie with the provided name from the URL.
|
void |
saveFromResponse(okhttp3.HttpUrl url,
java.util.List<okhttp3.Cookie> cookies)
Saves cookies from an HTTP response.
|
void |
setCookie(@NonNull okhttp3.HttpUrl url,
@NonNull okhttp3.Cookie cookie)
Sets a cookie for the provided URL.
|
void |
setCookie(@NonNull okhttp3.HttpUrl url,
@NonNull java.lang.String name,
@NonNull java.lang.String value)
Sets a cookie with the provided name and value for the URL.
|
void |
setCookie(@NonNull java.lang.String url,
@NonNull okhttp3.Cookie cookie)
Sets a cookie for the provided URL.
|
void |
setCookie(@NonNull java.lang.String url,
@NonNull java.lang.String name,
@NonNull java.lang.String value)
Sets a cookie with the provided name and value for the URL.
|
public void saveFromResponse(okhttp3.HttpUrl url, java.util.List<okhttp3.Cookie> cookies)
saveFromResponse
in interface okhttp3.CookieJar
url
- the URLcookies
- the cookiespublic java.util.List<okhttp3.Cookie> loadForRequest(okhttp3.HttpUrl url)
loadForRequest
in interface okhttp3.CookieJar
url
- the URLpublic java.util.List<okhttp3.Cookie> getCookies(@NonNull @NonNull java.lang.String url)
url
- the URLpublic java.util.List<okhttp3.Cookie> getCookies(@NonNull @NonNull okhttp3.HttpUrl url)
url
- the urljava.lang.NullPointerException
- if URL is nullpublic void setCookie(@NonNull @NonNull java.lang.String url, @NonNull @NonNull okhttp3.Cookie cookie)
url
- the URLcookie
- the cookiejava.lang.NullPointerException
- if any parameters are nullpublic void setCookie(@NonNull @NonNull okhttp3.HttpUrl url, @NonNull @NonNull okhttp3.Cookie cookie)
url
- the URLcookie
- the cookiejava.lang.NullPointerException
- if any parameters are nullpublic void setCookie(@NonNull @NonNull java.lang.String url, @NonNull @NonNull java.lang.String name, @NonNull @NonNull java.lang.String value)
url
- the URLname
- the cookie namevalue
- the cookie valuejava.lang.NullPointerException
- if any parameters are nullpublic void setCookie(@NonNull @NonNull okhttp3.HttpUrl url, @NonNull @NonNull java.lang.String name, @NonNull @NonNull java.lang.String value)
url
- the urlname
- the cookie namevalue
- the cookie valuejava.lang.NullPointerException
- if any parameters are nullpublic void removeCookie(java.lang.String url, java.lang.String name)
url
- the URLname
- the cookie namepublic void removeCookie(okhttp3.HttpUrl url, java.lang.String name)
url
- the URLname
- the cookie name