Class GerritSCMFileSystem.BuilderImpl
java.lang.Object
jenkins.scm.api.SCMFileSystem.Builder
io.jenkins.plugins.gerritlightweight.GerritSCMFileSystem.BuilderImpl
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
GerritSCMFileSystem
@Extension(ordinal=100.0)
public static final class GerritSCMFileSystem.BuilderImpl
extends jenkins.scm.api.SCMFileSystem.Builder
Selects REST retrieval for Git SCMs explicitly configured with
GerritRestCheckout.
The extension ordinal gives this builder priority over the default Git provider.
SCM source discovery is unsupported.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjenkins.scm.api.SCMFileSystemBuilds a REST filesystem without a build environment for variable expansion.jenkins.scm.api.SCMFileSystemBuilds a fixed REST filesystem using job-scoped HTTP credentials.booleanChecks whether a Git SCM explicitly enables this REST provider.booleansupports(jenkins.scm.api.SCMSource source) Reports that this builder does not directly support SCM sources.protected booleansupportsDescriptor(SCMDescriptor descriptor) Identifies Git SCM descriptors as potentially supported; individual jobs must opt in.protected booleansupportsDescriptor(jenkins.scm.api.SCMSourceDescriptor descriptor) Reports that SCM source descriptors are unsupported.Methods inherited from class jenkins.scm.api.SCMFileSystem.Builder
build, supports, supports
-
Constructor Details
-
BuilderImpl
public BuilderImpl()
-
-
Method Details
-
supports
Checks whether a Git SCM explicitly enables this REST provider.- Specified by:
supportsin classjenkins.scm.api.SCMFileSystem.Builder- Parameters:
scm- SCM configuration to inspect- Returns:
- whether the Gerrit REST behavior is present
-
supports
public boolean supports(jenkins.scm.api.SCMSource source) Reports that this builder does not directly support SCM sources.- Specified by:
supportsin classjenkins.scm.api.SCMFileSystem.Builder- Parameters:
source- SCM source to inspect- Returns:
false
-
supportsDescriptor
Identifies Git SCM descriptors as potentially supported; individual jobs must opt in.- Specified by:
supportsDescriptorin classjenkins.scm.api.SCMFileSystem.Builder- Parameters:
descriptor- SCM descriptor to inspect- Returns:
- whether the descriptor belongs to Git SCM
-
supportsDescriptor
protected boolean supportsDescriptor(jenkins.scm.api.SCMSourceDescriptor descriptor) Reports that SCM source descriptors are unsupported.- Specified by:
supportsDescriptorin classjenkins.scm.api.SCMFileSystem.Builder- Parameters:
descriptor- SCM source descriptor to inspect- Returns:
false
-
build
public jenkins.scm.api.SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, jenkins.scm.api.SCMRevision revision) throws IOException, InterruptedException Builds a REST filesystem without a build environment for variable expansion.- Overrides:
buildin classjenkins.scm.api.SCMFileSystem.Builder- Parameters:
owner- item owning the SCM configuration and credential scopescm- SCM configurationrevision- requested Git revision, ornullto resolve the configured branch- Returns:
- fixed REST filesystem, or
nullfor an unsupported SCM or revision type - Throws:
IOException- if configuration, credential lookup or ref resolution failsInterruptedException- if filesystem initialization is interrupted
-
build
public jenkins.scm.api.SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, jenkins.scm.api.SCMRevision revision, Run<?, ?> run) throws IOException, InterruptedExceptionBuilds a fixed REST filesystem using job-scoped HTTP credentials. Requires one Git remote and one branch. A supplied Git revision takes precedence over the branch; otherwise, branch variables are expanded from the build environment when available.- Overrides:
buildin classjenkins.scm.api.SCMFileSystem.Builder- Parameters:
owner- item owning the SCM configuration and credential scopescm- SCM configurationrevision- requested Git revision, ornullto resolve the configured branchrun- optional build context for branch expansion and credential lookup- Returns:
- fixed REST filesystem, or
nullfor an unsupported SCM or revision type - Throws:
IOException- if configuration, credential lookup, environment loading or ref resolution failsInterruptedException- if obtaining the build environment is interrupted
-