com.loopj.android.http
Class PersistentCookieStore
java.lang.Object
com.loopj.android.http.PersistentCookieStore
- All Implemented Interfaces:
- CookieStore
public class PersistentCookieStore
- extends Object
- implements CookieStore
A persistent cookie store which implements the Apache HttpClient
CookieStore interface. Cookies are stored and will persist on the
user's device between application sessions since they are serialized and
stored in SharedPreferences.
Instances of this class are designed to be used with
AsyncHttpClient.setCookieStore(org.apache.http.client.CookieStore), but can also be used with a
regular old apache HttpClient/HttpContext if you prefer.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PersistentCookieStore
public PersistentCookieStore(Context context)
- Construct a persistent cookie store.
addCookie
public void addCookie(Cookie cookie)
- Specified by:
addCookie in interface CookieStore
clear
public void clear()
- Specified by:
clear in interface CookieStore
clearExpired
public boolean clearExpired(Date date)
- Specified by:
clearExpired in interface CookieStore
getCookies
public List<Cookie> getCookies()
- Specified by:
getCookies in interface CookieStore
encodeCookie
protected String encodeCookie(SerializableCookie cookie)
decodeCookie
protected Cookie decodeCookie(String cookieStr)
byteArrayToHexString
protected String byteArrayToHexString(byte[] b)
hexStringToByteArray
protected byte[] hexStringToByteArray(String s)