public class FileSystemJarCache extends JarCacheSupport
JarCache
that stores files in a single directory.Modifier and Type | Field and Description |
---|---|
File |
rootDir |
DEFAULT_NOWS_JAR_CACHE_LOCATION
Constructor and Description |
---|
FileSystemJarCache(File rootDir,
boolean touch) |
Modifier and Type | Method and Description |
---|---|
protected URL |
lookInCache(Channel channel,
long sum1,
long sum2)
Look up the local cache and return URL if found.
|
protected URL |
retrieve(Channel channel,
long sum1,
long sum2)
Retrieve the jar file from the given
JarLoader , store it, then return the URL to that jar. |
String |
toString() |
getJarLoader, resolve
public final File rootDir
public FileSystemJarCache(@NonNull File rootDir, boolean touch)
rootDir
- Root directory.touch
- True to touch the cached jar file that's used. This enables external LRU based cache
eviction at the expense of increased I/O.IllegalArgumentException
- Root directory is null
or not writable.protected URL lookInCache(Channel channel, long sum1, long sum2) throws IOException, InterruptedException
JarCacheSupport
lookInCache
in class JarCacheSupport
IOException
InterruptedException
protected URL retrieve(Channel channel, long sum1, long sum2) throws IOException, InterruptedException
JarCacheSupport
JarLoader
, store it, then return the URL to that jar.retrieve
in class JarCacheSupport
IOException
InterruptedException
Copyright © 2004–2022. All rights reserved.