本文整理汇总了Java中ch.boye.httpclientandroidlib.client.CookieStore类的典型用法代码示例。如果您正苦于以下问题:Java CookieStore类的具体用法?Java CookieStore怎么用?Java CookieStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CookieStore类属于ch.boye.httpclientandroidlib.client包,在下文中一共展示了CookieStore类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InternalHttpClient
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public InternalHttpClient(
final ClientExecChain execChain,
final HttpClientConnectionManager connManager,
final HttpRoutePlanner routePlanner,
final Lookup<CookieSpecProvider> cookieSpecRegistry,
final Lookup<AuthSchemeProvider> authSchemeRegistry,
final CookieStore cookieStore,
final CredentialsProvider credentialsProvider,
final RequestConfig defaultConfig,
final List<Closeable> closeables) {
super();
Args.notNull(execChain, "HTTP client exec chain");
Args.notNull(connManager, "HTTP connection manager");
Args.notNull(routePlanner, "HTTP route planner");
this.execChain = execChain;
this.connManager = connManager;
this.routePlanner = routePlanner;
this.cookieSpecRegistry = cookieSpecRegistry;
this.authSchemeRegistry = authSchemeRegistry;
this.cookieStore = cookieStore;
this.credentialsProvider = credentialsProvider;
this.defaultConfig = defaultConfig;
this.closeables = closeables;
}
示例2: process
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public void process(final HttpResponse response, final HttpContext context)
throws HttpException, IOException {
Args.notNull(response, "HTTP request");
Args.notNull(context, "HTTP context");
final HttpClientContext clientContext = HttpClientContext.adapt(context);
// Obtain actual CookieSpec instance
final CookieSpec cookieSpec = clientContext.getCookieSpec();
if (cookieSpec == null) {
this.log.debug("Cookie spec not specified in HTTP context");
return;
}
// Obtain cookie store
final CookieStore cookieStore = clientContext.getCookieStore();
if (cookieStore == null) {
this.log.debug("Cookie store not specified in HTTP context");
return;
}
// Obtain actual CookieOrigin instance
final CookieOrigin cookieOrigin = clientContext.getCookieOrigin();
if (cookieOrigin == null) {
this.log.debug("Cookie origin not specified in HTTP context");
return;
}
HeaderIterator it = response.headerIterator(SM.SET_COOKIE);
processCookies(it, cookieSpec, cookieOrigin, cookieStore);
// see if the cookie spec supports cookie versioning.
if (cookieSpec.getVersion() > 0) {
// process set-cookie2 headers.
// Cookie2 will replace equivalent Cookie instances
it = response.headerIterator(SM.SET_COOKIE2);
processCookies(it, cookieSpec, cookieOrigin, cookieStore);
}
}
示例3: setCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public void setCookieStore(final CookieStore store) {
this.context.setAttribute(COOKIE_STORE, store);
}
示例4: getCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public CookieStore getCookieStore() {
return getAttribute(COOKIE_STORE, CookieStore.class);
}
示例5: setCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public void setCookieStore(final CookieStore cookieStore) {
setAttribute(COOKIE_STORE, cookieStore);
}
示例6: createCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
protected CookieStore createCookieStore() {
return new BasicCookieStore();
}
示例7: getCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public synchronized final CookieStore getCookieStore() {
if (cookieStore == null) {
cookieStore = createCookieStore();
}
return cookieStore;
}
示例8: setCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public synchronized void setCookieStore(final CookieStore cookieStore) {
this.cookieStore = cookieStore;
}
示例9: setDefaultCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
/**
* Assigns default {@link CookieStore} instance which will be used for
* request execution if not explicitly set in the client execution context.
*/
public final HttpClientBuilder setDefaultCookieStore(final CookieStore cookieStore) {
this.cookieStore = cookieStore;
return this;
}
示例10: getCookieStore
import ch.boye.httpclientandroidlib.client.CookieStore; //导入依赖的package包/类
public CookieStore getCookieStore() {
return cookieStore;
}