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 enumstatic final classNested classes/interfaces inherited from class jenkins.plugins.jobcacher.Cache
Cache.DirectorySize, Cache.SaverNested 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.HttpResponsedoDynamic(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.booleanvoidsetCacheName(String cacheName) voidsetCacheValidityDecidingFile(String cacheValidityDecidingFile) voidsetCompressionMethod(ArbitraryFileCache.CompressionMethod compressionMethod) voidsetExcludes(String excludes) voidsetIncludes(String includes) voidvoidsetUseDefaultExcludes(boolean useDefaultExcludes) Methods inherited from class jenkins.plugins.jobcacher.Cache
deriveCachePath, getJobMethods 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:CacheGets 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:CacheSeeds the cache on the executor from the cache storage system.- Specified by:
cachein 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:
IOExceptionjakarta.servlet.ServletExceptionInterruptedException
-