protected CookieSpecRegistry createCookieSpecRegistry() { CookieSpecRegistry registry = new CookieSpecRegistry(); registry.register( CookiePolicy.BEST_MATCH, new BestMatchSpecFactory()); registry.register( CookiePolicy.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory()); registry.register( CookiePolicy.NETSCAPE, new NetscapeDraftSpecFactory()); registry.register( CookiePolicy.RFC_2109, new RFC2109SpecFactory()); registry.register( CookiePolicy.RFC_2965, new RFC2965SpecFactory()); registry.register( CookiePolicy.IGNORE_COOKIES, new IgnoreSpecFactory()); return registry; }
protected CookieSpecRegistry createCookieSpecRegistry() { final CookieSpecRegistry registry = new CookieSpecRegistry(); registry.register( CookieSpecs.DEFAULT, new BestMatchSpecFactory()); registry.register( CookiePolicy.BEST_MATCH, new BestMatchSpecFactory()); registry.register( CookiePolicy.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory()); registry.register( CookiePolicy.NETSCAPE, new NetscapeDraftSpecFactory()); registry.register( CookiePolicy.RFC_2109, new RFC2109SpecFactory()); registry.register( CookiePolicy.RFC_2965, new RFC2965SpecFactory()); registry.register( CookiePolicy.IGNORE_COOKIES, new IgnoreSpecFactory()); return registry; }
@Override protected CookieSpecRegistry createCookieSpecRegistry() { CookieSpecRegistry registry = new CookieSpecRegistry(); registry.register( CookiePolicy.BEST_MATCH, new BestMatchSpecFactory()); registry.register( CookiePolicy.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory()); registry.register( CookiePolicy.NETSCAPE, new NetscapeDraftSpecFactory()); registry.register( CookiePolicy.RFC_2109, new RFC2109SpecFactory()); registry.register( CookiePolicy.RFC_2965, new RFC2965SpecFactory()); return registry; }
public static Executor createExecutor(CookieStore cookieStore) { @SuppressWarnings("deprecation") final Registry<CookieSpecProvider> cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create().register(CookieSpecs.DEFAULT, new BrowserCompatSpecFactory()).build(); final CloseableHttpClient client = HttpClients.custom() .setDefaultCookieSpecRegistry(cookieSpecRegistry) .setDefaultCookieStore(cookieStore) .build(); return Executor.newInstance(client); }
public static HttpClientContext getHttpClientContext() { HttpClientContext context = null; context = HttpClientContext.create(); Registry<CookieSpecProvider> registry = RegistryBuilder .<CookieSpecProvider>create() .register(CookieSpecs.BEST_MATCH, new BestMatchSpecFactory()) .register(CookieSpecs.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory()).build(); context.setCookieSpecRegistry(registry); return context; }