public JarCacheStorage(ClassLoader classLoader, CacheConfig cacheConfig) { this(classLoader, cacheConfig, new BasicHttpCacheStorage(cacheConfig)); }
public JarCacheStorage(ClassLoader classLoader, CacheConfig cacheConfig) { this(classLoader, cacheConfig, new BasicHttpCacheStorage(cacheConfig)); }
/** * Constructs a HttpJsonHomeClient using a HttpClient and a CacheConfig. * * Internally, these two are used to build a CachingHttpClient using a BasicHttpCacheStorage. * * @param httpClient non-caching HttpClient used to get resources. * @param cacheConfig configuration of the HttpCacheStorage */ public HttpJsonHomeClient(final HttpClient httpClient, final CacheConfig cacheConfig) { this.cacheStorage = new BasicHttpCacheStorage(cacheConfig); this.httpClient = new CachingHttpClient(httpClient, cacheStorage, cacheConfig); }
public BasicHttpCache(final CacheConfig config) { this(new HeapResourceFactory(), new BasicHttpCacheStorage(config), config); }
public BasicHttpCache(CacheConfig config) { this(new HeapResourceFactory(), new BasicHttpCacheStorage(config), config); }
private HttpCacheStorage createStorage() { CacheConfig config = new CacheConfig(); // if max cache entries value is not present the CacheConfig's default (CacheConfig.DEFAULT_MAX_CACHE_ENTRIES = 1000) will be used Integer maxCacheEntries = Integer.getInteger("bitbucket.client.cache.maxentries"); if (maxCacheEntries != null) { config.setMaxCacheEntries(maxCacheEntries); } return new BasicHttpCacheStorage(config); }
public EtagCachingHttpClient() { this(new DefaultHttpClient(), new BasicHttpCacheStorage(new CacheConfig())); }
@Override public void init(Properties properties) { CacheConfig cacheConfig = CacheConfigHelper.createCacheConfig(properties); setImpl(new BasicHttpCacheStorage(cacheConfig)); }
public EtagCachingHttpClient(HttpClient httpClient) { this(httpClient, new BasicHttpCacheStorage(new CacheConfig())); }
public static HttpClientBuilder createDefaultHttpClientBuilder(final CacheConfig cacheConfig) { // Common CacheConfig for both the JarCacheStorage and the underlying // BasicHttpCacheStorage return CachingHttpClientBuilder.create() // allow caching .setCacheConfig(cacheConfig) // Wrap the local JarCacheStorage around a BasicHttpCacheStorage .setHttpCacheStorage(new JarCacheStorage(null, cacheConfig, new BasicHttpCacheStorage(cacheConfig))) // Support compressed data // https://wayback.archive.org/web/20130901115452/http://hc.apache.org:80/httpcomponents-client-ga/tutorial/html/httpagent.html#d5e1238 .addInterceptorFirst(new RequestAcceptEncoding()) .addInterceptorFirst(new ResponseContentEncoding()) .setRedirectStrategy(DefaultRedirectStrategy.INSTANCE) // User agent customisation .setUserAgent(JSONLD_JAVA_USER_AGENT) // use system defaults for proxy etc. .useSystemProperties(); }
public static HttpClientBuilder createDefaultHttpClientBuilder(final CacheConfig cacheConfig) { // Common CacheConfig for both the JarCacheStorage and the underlying // BasicHttpCacheStorage return CachingHttpClientBuilder.create() // allow caching .setCacheConfig(cacheConfig) // Wrap the local JarCacheStorage around a BasicHttpCacheStorage .setHttpCacheStorage(new JarCacheStorage(null, cacheConfig, new BasicHttpCacheStorage(cacheConfig))) // Support compressed data // https://wayback.archive.org/web/20130901115452/http://hc.apache.org:80/httpcomponents-client-ga/tutorial/html/httpagent.html#d5e1238 .addInterceptorFirst(new RequestAcceptEncoding()) .addInterceptorFirst(new ResponseContentEncoding()) .setRedirectStrategy(DefaultRedirectStrategy.INSTANCE) // User agent customisation .setUserAgent(JSONLD_JAVA_USER_AGENT) // use system defaults for proxy etc. .useSystemProperties(); }
/** * Constructs a default HttpJsonHomeClient build on top of a CachingHttpClient with in-memory storage. */ public HttpJsonHomeClient() { final CacheConfig cacheConfig = CacheConfig.custom() .setMaxCacheEntries(100) .setMaxObjectSize(50000) .build(); this.cacheStorage = new BasicHttpCacheStorage(cacheConfig); this.httpClient = CachingHttpClientBuilder.create() .setHttpCacheStorage(cacheStorage) .setCacheConfig(cacheConfig) .build(); }
new BasicHttpCacheStorage(cacheConfig)))
if (storage == null) { if (this.cacheDir == null) { storage = new BasicHttpCacheStorage(config); } else { final ManagedHttpCacheStorage managedStorage = new ManagedHttpCacheStorage(config);