Class JarCacheStorage
java.lang.Object
com.github.jsonldjava.utils.JarCacheStorage
- All Implemented Interfaces:
org.apache.http.client.cache.HttpCacheStorage
public class JarCacheStorage
extends Object
implements org.apache.http.client.cache.HttpCacheStorage
Implementation of the Apache HttpClient
HttpCacheStorage interface
using jarcache.json files on the classpath to identify static JSON-LD
resources on the classpath, to avoid retrieving them.- Author:
- Stian Soiland-Reyes, Peter Ansell p_ansell@yahoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionJarCacheStorage(ClassLoader classLoader, org.apache.http.impl.client.cache.CacheConfig cacheConfig) JarCacheStorage(ClassLoader classLoader, org.apache.http.impl.client.cache.CacheConfig cacheConfig, org.apache.http.client.cache.HttpCacheStorage delegate) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.http.client.cache.HttpCacheEntrycacheEntry(URI requestedUri, URL baseURL, com.fasterxml.jackson.databind.JsonNode cacheNode) org.apache.http.impl.client.cache.CacheConfigorg.apache.http.client.cache.HttpCacheEntryprotected com.fasterxml.jackson.databind.JsonNodegetJarCache(URL url) voidvoidremoveEntry(String key) voidsetClassLoader(ClassLoader classLoader) Sets the ClassLoader used internally to a new value, or null to useThread.currentThread()andThread.getContextClassLoader()for each access.voidupdateEntry(String key, org.apache.http.client.cache.HttpCacheUpdateCallback callback)
-
Constructor Details
-
JarCacheStorage
public JarCacheStorage(ClassLoader classLoader, org.apache.http.impl.client.cache.CacheConfig cacheConfig) -
JarCacheStorage
public JarCacheStorage(ClassLoader classLoader, org.apache.http.impl.client.cache.CacheConfig cacheConfig, org.apache.http.client.cache.HttpCacheStorage delegate)
-
-
Method Details
-
getClassLoader
-
setClassLoader
Sets the ClassLoader used internally to a new value, or null to useThread.currentThread()andThread.getContextClassLoader()for each access.- Parameters:
classLoader- The classloader to use, or null to use the thread context classloader
-
putEntry
public void putEntry(String key, org.apache.http.client.cache.HttpCacheEntry entry) throws IOException - Specified by:
putEntryin interfaceorg.apache.http.client.cache.HttpCacheStorage- Throws:
IOException
-
getEntry
- Specified by:
getEntryin interfaceorg.apache.http.client.cache.HttpCacheStorage- Throws:
IOException
-
getJarCache
- Throws:
IOException
-
cacheEntry
protected org.apache.http.client.cache.HttpCacheEntry cacheEntry(URI requestedUri, URL baseURL, com.fasterxml.jackson.databind.JsonNode cacheNode) throws MalformedURLException, IOException - Throws:
MalformedURLExceptionIOException
-
removeEntry
- Specified by:
removeEntryin interfaceorg.apache.http.client.cache.HttpCacheStorage- Throws:
IOException
-
updateEntry
public void updateEntry(String key, org.apache.http.client.cache.HttpCacheUpdateCallback callback) throws IOException, org.apache.http.client.cache.HttpCacheUpdateException - Specified by:
updateEntryin interfaceorg.apache.http.client.cache.HttpCacheStorage- Throws:
IOExceptionorg.apache.http.client.cache.HttpCacheUpdateException
-
getCacheConfig
public org.apache.http.impl.client.cache.CacheConfig getCacheConfig()
-