Class Cache

    • Constructor Detail

      • Cache

        public Cache()
    • Method Detail

      • cache

        public abstract Cache.Saver cache​(ObjectPath cache,
                                          ObjectPath defaultCache,
                                          Run<?,​?> build,
                                          FilePath workspace,
                                          Launcher launcher,
                                          TaskListener listener,
                                          EnvVars initialEnvironment,
                                          boolean skipRestore)
                                   throws IOException,
                                          InterruptedException
        Seeds the cache on the executor from the cache storage system.
        Parameters:
        cache - The root of the object cache
        defaultCache - The root of the alternate default object cache
        build - The build in progress
        workspace - The executor workspace
        launcher - The launcher
        listener - The task listener
        initialEnvironment - The initial environment variables
        skipRestore - Whether to skip restoring the cache
        Throws:
        IOException - If an error occurs connecting to the potentially remote executor
        InterruptedException - If interrupted
      • getTitle

        public abstract String getTitle()
        Gets the human-readable title for this cache to be shown on the user interface.
        Returns:
        The title of the cache
      • getJob

        public Job<?,​?> getJob()
        Gets the ancestor job when invoked via the stapler context.
        Returns:
        the job
      • deriveCachePath

        public static String deriveCachePath​(String path)
        Generates a path within the cache dir given a relative or absolute path that is being cached.
        Parameters:
        path - The relative or absolute path that is being cached
        Returns:
        A filepath where to save and read from the cache