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
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static final class
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 -
Method Summary
Modifier and TypeMethodDescriptioncache
(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.org.kohsuke.stapler.HttpResponse
doDynamic
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Job<?, ?> job) getPath()
getTitle()
Gets the human-readable title for this cache to be shown on the user interface.boolean
void
setCacheName
(String cacheName) void
setCacheValidityDecidingFile
(String cacheValidityDecidingFile) void
setCompressionMethod
(ArbitraryFileCache.CompressionMethod compressionMethod) void
setExcludes
(String excludes) void
setIncludes
(String includes) void
void
setUseDefaultExcludes
(boolean useDefaultExcludes) Methods inherited from class jenkins.plugins.jobcacher.Cache
deriveCachePath, getJob
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
ArbitraryFileCache
-
-
Method Details
-
setUseDefaultExcludes
@DataBoundSetter public void setUseDefaultExcludes(boolean useDefaultExcludes) -
getUseDefaultExcludes
public boolean getUseDefaultExcludes() -
setCompressionMethod
@DataBoundSetter public void setCompressionMethod(ArbitraryFileCache.CompressionMethod compressionMethod) -
getCompressionMethod
-
setCacheValidityDecidingFile
-
getCacheValidityDecidingFile
-
setPath
-
getPath
-
setIncludes
-
getIncludes
-
setExcludes
-
getExcludes
-
getCacheName
-
setCacheName
-
createCacheBaseName
-
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, InterruptedExceptionDescription 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.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @AncestorInPath Job<?, ?> job) throws IOException, jakarta.servlet.ServletException, InterruptedException- Throws:
IOException
jakarta.servlet.ServletException
InterruptedException
-