public class PersistentCookieStore
extends java.lang.Object
SharedPreferences. Instances of this class are designed to be used with
AsyncHttpClient.setCookieStore(CookieStore), but can also be used with a
regular old apache HttpClient/HttpContext if you prefer.| 构造器和说明 |
|---|
PersistentCookieStore(android.content.Context context)
Construct a persistent cookie store.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addCookie(Cookie cookie) |
protected java.lang.String |
byteArrayToHexString(byte[] bytes)
Using some super basic byte array <-> hex conversions so we don't have to rely on any
large Base64 libraries.
|
void |
clear() |
boolean |
clearExpired(java.util.Date date) |
protected Cookie |
decodeCookie(java.lang.String cookieString)
Returns cookie decoded from cookie string
|
void |
deleteCookie(Cookie cookie)
Non-standard helper method, to delete cookie
|
protected java.lang.String |
encodeCookie(SerializableCookie cookie)
Serializes Cookie object into String
|
java.util.List<Cookie> |
getCookies() |
protected byte[] |
hexStringToByteArray(java.lang.String hexString)
Converts hex values from strings to byte arra
|
void |
setOmitNonPersistentCookies(boolean omitNonPersistentCookies)
Will make PersistentCookieStore instance ignore Cookies, which are non-persistent by
signature (`Cookie.isPersistent`)
|
public PersistentCookieStore(android.content.Context context)
context - Context to attach cookie store topublic void addCookie(Cookie cookie)
public void clear()
public boolean clearExpired(java.util.Date date)
public java.util.List<Cookie> getCookies()
public void setOmitNonPersistentCookies(boolean omitNonPersistentCookies)
omitNonPersistentCookies - true if non-persistent cookies should be omitedpublic void deleteCookie(Cookie cookie)
cookie - cookie to be removedprotected java.lang.String encodeCookie(SerializableCookie cookie)
cookie - cookie to be encoded, can be nullprotected Cookie decodeCookie(java.lang.String cookieString)
cookieString - string of cookie as returned from http requestprotected java.lang.String byteArrayToHexString(byte[] bytes)
bytes - byte array to be convertedprotected byte[] hexStringToByteArray(java.lang.String hexString)
hexString - string of hex-encoded values