Package hudson.remoting
Class FileSystemJarCache
- java.lang.Object
-
- hudson.remoting.JarCache
-
- hudson.remoting.JarCacheSupport
-
- hudson.remoting.FileSystemJarCache
-
public class FileSystemJarCache extends JarCacheSupport
JarCache
that stores files in a single directory.- Since:
- 2.24
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description File
rootDir
-
Fields inherited from class hudson.remoting.JarCache
DEFAULT_NOWS_JAR_CACHE_LOCATION
-
-
Constructor Summary
Constructors Constructor Description FileSystemJarCache(File rootDir, boolean touch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 givenJarLoader
, store it, then return the URL to that jar.String
toString()
-
Methods inherited from class hudson.remoting.JarCacheSupport
getJarLoader, resolve
-
-
-
-
Field Detail
-
rootDir
public final File rootDir
-
-
Constructor Detail
-
FileSystemJarCache
public FileSystemJarCache(@NonNull File rootDir, boolean touch)
- Parameters:
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.- Throws:
IllegalArgumentException
- Root directory isnull
or not writable.
-
-
Method Detail
-
lookInCache
protected URL lookInCache(Channel channel, long sum1, long sum2) throws IOException, InterruptedException
Description copied from class:JarCacheSupport
Look up the local cache and return URL if found. Otherwise null (which will trigger a remote retrieval.)- Specified by:
lookInCache
in classJarCacheSupport
- Throws:
IOException
InterruptedException
-
retrieve
protected URL retrieve(Channel channel, long sum1, long sum2) throws IOException, InterruptedException
Description copied from class:JarCacheSupport
Retrieve the jar file from the givenJarLoader
, store it, then return the URL to that jar.- Specified by:
retrieve
in classJarCacheSupport
- Returns:
- must not be null
- Throws:
IOException
InterruptedException
-
-