/** * Creates a new AsyncHttpClient. * * @throws IOException */ public AsyncHttpClient(Context context) throws IOException { cachingHttpClient = SurespotCachingHttpClient.createSurespotDiskCachingHttpClient(context); httpContext = new SyncBasicHttpContext(new BasicHttpContext()); threadPool = (ThreadPoolExecutor) Executors.newCachedThreadPool(); requestMap = new WeakHashMap<Context, List<WeakReference<Future<?>>>>(); clientHeaderMap = new HashMap<String, String>(); }
/** * Sets an optional CookieStore to use when making requests * * @param cookieStore The CookieStore implementation to use, usually an instance of {@link * PersistentCookieStore} */ public void setCookieStore(CookieStore cookieStore) { cachingHttpClient.getAbstractHttpClient().setCookieStore(cookieStore); }
public void clearCache() { cachingHttpClient.clearCache(); }
public AbstractHttpClient getAbstractHttpClient() { return cachingHttpClient.getAbstractHttpClient(); }