Class FolderLibraries.ForJob

java.lang.Object
org.jenkinsci.plugins.workflow.libs.LibraryResolver
org.jenkinsci.plugins.workflow.libs.FolderLibraries.ForJob
All Implemented Interfaces:
ExtensionPoint
Enclosing class:
FolderLibraries

@Extension(ordinal=100.0) public static class FolderLibraries.ForJob extends LibraryResolver
  • Constructor Details

    • ForJob

      public ForJob()
  • Method Details

    • isTrusted

      public boolean isTrusted()
      Description copied from class: LibraryResolver
      Whether these libraries should be run outside the sandbox.
      Specified by:
      isTrusted in class LibraryResolver
    • forJob

      public Collection<LibraryConfiguration> forJob(Job<?,?> job, Map<String,String> libraryVersions)
      Description copied from class: LibraryResolver
      Check for libraries visible to a given job.

      An implementation may ignore the libraryVersions parameter and simply list configured libraries visible to the job; the caller will select which libraries to actually load, taking into account LibraryConfiguration.isImplicit(). Or it may dynamically generate library configurations by matching library names against some predefined pattern.

      By returning a library with a matching name, this resolver “claims” that entry of libraryVersions; subsequent resolvers will not be offered that entry. It is an error if no resolver claims a given entry. Multiple resolvers might return a library of a given name if the libraries are implicit, in which case only the first will be loaded.

      Specified by:
      forJob in class LibraryResolver
      Parameters:
      job - a job
      libraryVersions - libraries explicitly requested in the job, as a map from LibraryConfiguration.getName() to version or null; may be empty
      Returns:
      a possibly empty collection of associated libraries
    • fromConfiguration

      public Collection<LibraryConfiguration> fromConfiguration(org.kohsuke.stapler.StaplerRequest request)
      Description copied from class: LibraryResolver
      A list of libraries that may have already been configured in this context. Implementations should only return libraries that the current user has permission to configure in this context.
      Overrides:
      fromConfiguration in class LibraryResolver
      Parameters:
      request - a web request
      Returns:
      known libraries, if any (empty by default)
    • suggestedConfigurations

      public Collection<LibraryConfiguration> suggestedConfigurations(ItemGroup<?> group)
      Description copied from class: LibraryResolver
      A list of libraries that might be visible in a given location. Typically would be the same as LibraryResolver.forJob(hudson.model.Job<?, ?>, java.util.Map<java.lang.String, java.lang.String>) applied to AbstractItem.getParent(). If a resolver can dynamically generate library configurations, it can simply return one or more examples here.
      Overrides:
      suggestedConfigurations in class LibraryResolver
      Parameters:
      group - Jenkins root or some folder
      Returns:
      any suggested libraries (empty by default)