Package jenkins.scm.api
Class SCMFileSystem.Builder
java.lang.Object
jenkins.scm.api.SCMFileSystem.Builder
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
- SCMFileSystem
Extension point that allows different plugins to implement
SCMFileSystem classes for the same SCM
or SCMSource and let Jenkins pick the most capable for any specific SCM implementation.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(Item owner, SCM scm, SCMRevision rev) Given aSCMthis should try to build a correspondingSCMFileSysteminstance that reflects the content at the specifiedSCMRevision.build(Item owner, SCM scm, SCMRevision rev, Run<?, ?> _build) Given aSCMthis should try to build a correspondingSCMFileSysteminstance that reflects the content at the specifiedSCMRevision.build(SCMSource source, SCMHead head, SCMRevision rev) Given aSCMSource, aSCMHeadand aSCMRevisionthis method should try to build a correspondingSCMFileSysteminstance that reflects the content of the specifiedSCMHeadat the specifiedSCMRevision.abstract booleanChecks if thisSCMFileSystem.Buildersupports the suppliedSCM.final booleansupports(SCMDescriptor<?> descriptor) Checks if thisSCMFileSystem.Buildersupports the suppliedSCMDescriptor.abstract booleanChecks if thisSCMFileSystem.Buildersupports the suppliedSCMSource.final booleansupports(SCMSourceDescriptor descriptor) Checks if thisSCMFileSystem.Buildersupports the suppliedSCMSourceDescriptor.protected abstract booleansupportsDescriptor(SCMDescriptor descriptor) Checks if thisSCMFileSystem.Buildersupports the suppliedSCMDescriptor.protected abstract booleansupportsDescriptor(SCMSourceDescriptor descriptor) Checks if thisSCMFileSystem.Buildersupports the suppliedSCMSourceDescriptor.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
supports
Checks if thisSCMFileSystem.Buildersupports the suppliedSCM.- Parameters:
source- theSCM.- Returns:
trueif and only if the suppliedSCMis supported by thisSCMFileSystem.Builder,falseifbuild(Item, SCM, SCMRevision)will always returnnull.
-
supports
Checks if thisSCMFileSystem.Buildersupports the suppliedSCMSource.- Parameters:
source- theSCMSource.- Returns:
trueif and only if the suppliedSCMSourceis supported by thisSCMFileSystem.Builder,falseifbuild(SCMSource, SCMHead, SCMRevision)will always returnnull.
-
supports
Checks if thisSCMFileSystem.Buildersupports the suppliedSCMDescriptor.- Parameters:
descriptor- theSCMDescriptor- Returns:
- the return value of
supportsDescriptor(SCMDescriptor)if implemented, otherwise, it will return true if one of the following is true: theSCMfor the descriptor is the enclosing class of this builder class, the builder andSCMare in the same package, or the builder is in a child package of theSCM. - Since:
- 2.3.0
-
supportsDescriptor
Checks if thisSCMFileSystem.Buildersupports the suppliedSCMDescriptor.- Parameters:
descriptor- theSCMDescriptor- Returns:
trueif and only if the suppliedSCMSourceDescriptor'sSCMDescriptorclass is supported by thisSCMFileSystem.Builder.- Since:
- 2.3.0
-
supports
Checks if thisSCMFileSystem.Buildersupports the suppliedSCMSourceDescriptor.- Parameters:
descriptor- theSCMSourceDescriptor- Returns:
- the return value of
supportsDescriptor(SCMSourceDescriptor)if implemented, otherwise, it will return true if one of the following is true: theSCMSourcefor the descriptor is the enclosing class of this builder class, the builder andSCMSourceare in the same package, or the builder is in a child package of theSCMSource. - Since:
- 2.3.0
-
supportsDescriptor
Checks if thisSCMFileSystem.Buildersupports the suppliedSCMSourceDescriptor.- Parameters:
descriptor- theSCMSourceDescriptor- Returns:
trueif and only if the suppliedSCMSourceDescriptor'sSCMSourceclass is supported by thisSCMFileSystem.Builder,falseifbuild(SCMSource, SCMHead, SCMRevision)will always returnnull, andfalseby default for compatibility.- Since:
- 2.3.0
-
build
@CheckForNull public SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull SCMRevision rev) throws IOException, InterruptedException Given aSCMthis should try to build a correspondingSCMFileSysteminstance that reflects the content at the specifiedSCMRevision. If theSCMis supported but not for a fixed revision, best effort is acceptable as the most capableSCMFileSystemwill be returned to the caller.- Parameters:
owner- the owner of theSCMscm- theSCM.rev- the specifiedSCMRevision.- Returns:
- the corresponding
SCMFileSystemornullif this builder cannot create aSCMFileSystemfor the specifiedSCM. - Throws:
IOException- if the attempt to create aSCMFileSystemfailed due to an IO error (such as the remote system being unavailable)InterruptedException- if the attempt to create aSCMFileSystemwas interrupted.
-
build
@CheckForNull public SCMFileSystem build(@NonNull SCMSource source, @NonNull SCMHead head, @CheckForNull SCMRevision rev) throws IOException, InterruptedException Given aSCMSource, aSCMHeadand aSCMRevisionthis method should try to build a correspondingSCMFileSysteminstance that reflects the content of the specifiedSCMHeadat the specifiedSCMRevision. If theSCMSourceis supported but not for a fixed revision, best effort is acceptable as the most capableSCMFileSystemwill be returned to the caller.- Parameters:
source- theSCMSource.head- the specifiedSCMHead.rev- the specifiedSCMRevision.- Returns:
- the corresponding
SCMFileSystemornullif there is none. - Throws:
IOException- if the attempt to create aSCMFileSystemfailed due to an IO error (such as the remote system being unavailable)InterruptedException- if the attempt to create aSCMFileSystemwas interrupted.
-
build
@CheckForNull public SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull SCMRevision rev, @CheckForNull Run<?, ?> _build) throws IOException, InterruptedExceptionGiven aSCMthis should try to build a correspondingSCMFileSysteminstance that reflects the content at the specifiedSCMRevision. If theSCMis supported but not for a fixed revision, best effort is acceptable as the most capableSCMFileSystemwill be returned to the caller. If theRunis provided, it can be used to alter the behavior. For example, variables in the branch name can be expanded based on current build properties, etc.- Parameters:
owner- the owner of theSCMscm- theSCM.rev- the specifiedSCMRevision._build- the specifiedRun.- Returns:
- the corresponding
SCMFileSystemornullif this builder cannot create aSCMFileSystemfor the specifiedSCM. - Throws:
IOException- if the attempt to create aSCMFileSystemfailed due to an IO error (such as the remote system being unavailable)InterruptedException- if the attempt to create aSCMFileSystemwas interrupted.
-