當前位置: 首頁>>代碼示例>>Java>>正文


Java CookieStore類代碼示例

本文整理匯總了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;
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:25,代碼來源:InternalHttpClient.java

示例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);
    }
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:37,代碼來源:ResponseProcessCookies.java

示例3: setCookieStore

import ch.boye.httpclientandroidlib.client.CookieStore; //導入依賴的package包/類
public void setCookieStore(final CookieStore store) {
    this.context.setAttribute(COOKIE_STORE, store);
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:4,代碼來源:ClientContextConfigurer.java

示例4: getCookieStore

import ch.boye.httpclientandroidlib.client.CookieStore; //導入依賴的package包/類
public CookieStore getCookieStore() {
    return getAttribute(COOKIE_STORE, CookieStore.class);
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:4,代碼來源:HttpClientContext.java

示例5: setCookieStore

import ch.boye.httpclientandroidlib.client.CookieStore; //導入依賴的package包/類
public void setCookieStore(final CookieStore cookieStore) {
    setAttribute(COOKIE_STORE, cookieStore);
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:4,代碼來源:HttpClientContext.java

示例6: createCookieStore

import ch.boye.httpclientandroidlib.client.CookieStore; //導入依賴的package包/類
protected CookieStore createCookieStore() {
    return new BasicCookieStore();
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:4,代碼來源:AbstractHttpClient.java

示例7: getCookieStore

import ch.boye.httpclientandroidlib.client.CookieStore; //導入依賴的package包/類
public synchronized final CookieStore getCookieStore() {
    if (cookieStore == null) {
        cookieStore = createCookieStore();
    }
    return cookieStore;
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:7,代碼來源:AbstractHttpClient.java

示例8: setCookieStore

import ch.boye.httpclientandroidlib.client.CookieStore; //導入依賴的package包/類
public synchronized void setCookieStore(final CookieStore cookieStore) {
    this.cookieStore = cookieStore;
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:4,代碼來源:AbstractHttpClient.java

示例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;
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:9,代碼來源:HttpClientBuilder.java

示例10: getCookieStore

import ch.boye.httpclientandroidlib.client.CookieStore; //導入依賴的package包/類
public CookieStore getCookieStore() {
    return cookieStore;
}
 
開發者ID:eleks,項目名稱:rnd-android-wear-tesla,代碼行數:4,代碼來源:ApiEngine.java


注:本文中的ch.boye.httpclientandroidlib.client.CookieStore類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。