Package jenkins.plugins.jobcacher
Class ArbitraryFileCache
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<Cache>
-
- jenkins.plugins.jobcacher.Cache
-
- jenkins.plugins.jobcacher.ArbitraryFileCache
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Cache>
,Serializable
public class ArbitraryFileCache extends Cache
This class implements a Cache where the user can configure a path on the executor that will be cached. Users can reference environment variables on the executor in the path and supply an includes and excludes pattern to limit the files that are cached.- Author:
- Peter Hayes
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ArbitraryFileCache.CompressionMethod
static class
ArbitraryFileCache.DescriptorImpl
-
Nested classes/interfaces inherited from class jenkins.plugins.jobcacher.Cache
Cache.DirectorySize, Cache.Saver
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description ArbitraryFileCache(String path, String includes, String excludes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Cache.Saver
cache(ObjectPath cachesRoot, ObjectPath fallbackCachesRoot, Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment, boolean skipRestore)
Seeds the cache on the executor from the cache storage system.String
createCacheBaseName()
org.kohsuke.stapler.HttpResponse
doDynamic(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, Job<?,?> job)
String
getCacheName()
String
getCacheValidityDecidingFile()
ArbitraryFileCache.CompressionMethod
getCompressionMethod()
String
getExcludes()
String
getIncludes()
String
getPath()
String
getTitle()
Gets the human-readable title for this cache to be shown on the user interface.boolean
getUseDefaultExcludes()
void
setCacheName(String cacheName)
void
setCacheValidityDecidingFile(String cacheValidityDecidingFile)
void
setCompressionMethod(ArbitraryFileCache.CompressionMethod compressionMethod)
void
setExcludes(String excludes)
void
setIncludes(String includes)
void
setPath(String path)
void
setUseDefaultExcludes(boolean useDefaultExcludes)
-
Methods inherited from class jenkins.plugins.jobcacher.Cache
deriveCachePath, getJob
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Method Detail
-
setUseDefaultExcludes
@DataBoundSetter public void setUseDefaultExcludes(boolean useDefaultExcludes)
-
getUseDefaultExcludes
public boolean getUseDefaultExcludes()
-
setCompressionMethod
@DataBoundSetter public void setCompressionMethod(ArbitraryFileCache.CompressionMethod compressionMethod)
-
getCompressionMethod
public ArbitraryFileCache.CompressionMethod getCompressionMethod()
-
setCacheValidityDecidingFile
@DataBoundSetter public void setCacheValidityDecidingFile(String cacheValidityDecidingFile)
-
getCacheValidityDecidingFile
public String getCacheValidityDecidingFile()
-
setPath
public void setPath(String path)
-
getPath
public String getPath()
-
setIncludes
public void setIncludes(String includes)
-
getIncludes
public String getIncludes()
-
setExcludes
public void setExcludes(String excludes)
-
getExcludes
public String getExcludes()
-
getCacheName
public String getCacheName()
-
setCacheName
@DataBoundSetter public void setCacheName(String cacheName)
-
createCacheBaseName
public String createCacheBaseName()
-
getTitle
public String getTitle()
Description copied from class:Cache
Gets the human-readable title for this cache to be shown on the user interface.
-
cache
public Cache.Saver cache(ObjectPath cachesRoot, ObjectPath fallbackCachesRoot, Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment, boolean skipRestore) throws IOException, InterruptedException
Description copied from class:Cache
Seeds the cache on the executor from the cache storage system.- Specified by:
cache
in classCache
- Parameters:
cachesRoot
- The root of the object cachefallbackCachesRoot
- The root of the alternate default object cachebuild
- The build in progressworkspace
- The executor workspacelauncher
- The launcherlistener
- The task listenerinitialEnvironment
- The initial environment variablesskipRestore
- Whether to skip restoring the cache- Throws:
IOException
- If an error occurs connecting to the potentially remote executorInterruptedException
- If interrupted
-
doDynamic
public org.kohsuke.stapler.HttpResponse doDynamic(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @AncestorInPath Job<?,?> job) throws IOException, javax.servlet.ServletException, InterruptedException
- Throws:
IOException
javax.servlet.ServletException
InterruptedException
-
-