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
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(Item owner, SCM scm, SCMRevision rev) Given aSCM
this should try to build a correspondingSCMFileSystem
instance that reflects the content at the specifiedSCMRevision
.build
(Item owner, SCM scm, SCMRevision rev, Run<?, ?> _build) Given aSCM
this should try to build a correspondingSCMFileSystem
instance that reflects the content at the specifiedSCMRevision
.build
(SCMSource source, SCMHead head, SCMRevision rev) Given aSCMSource
, aSCMHead
and aSCMRevision
this method should try to build a correspondingSCMFileSystem
instance that reflects the content of the specifiedSCMHead
at the specifiedSCMRevision
.abstract boolean
Checks if thisSCMFileSystem.Builder
supports the suppliedSCM
.final boolean
supports
(SCMDescriptor<?> descriptor) Checks if thisSCMFileSystem.Builder
supports the suppliedSCMDescriptor
.abstract boolean
Checks if thisSCMFileSystem.Builder
supports the suppliedSCMSource
.final boolean
supports
(SCMSourceDescriptor descriptor) Checks if thisSCMFileSystem.Builder
supports the suppliedSCMSourceDescriptor
.protected abstract boolean
supportsDescriptor
(SCMDescriptor descriptor) Checks if thisSCMFileSystem.Builder
supports the suppliedSCMDescriptor
.protected abstract boolean
supportsDescriptor
(SCMSourceDescriptor descriptor) Checks if thisSCMFileSystem.Builder
supports the suppliedSCMSourceDescriptor
.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
supports
Checks if thisSCMFileSystem.Builder
supports the suppliedSCM
.- Parameters:
source
- theSCM
.- Returns:
true
if and only if the suppliedSCM
is supported by thisSCMFileSystem.Builder
,false
ifbuild(Item, SCM, SCMRevision)
will always returnnull
.
-
supports
Checks if thisSCMFileSystem.Builder
supports the suppliedSCMSource
.- Parameters:
source
- theSCMSource
.- Returns:
true
if and only if the suppliedSCMSource
is supported by thisSCMFileSystem.Builder
,false
ifbuild(SCMSource, SCMHead, SCMRevision)
will always returnnull
.
-
supports
Checks if thisSCMFileSystem.Builder
supports 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: theSCM
for the descriptor is the enclosing class of this builder class, the builder andSCM
are in the same package, or the builder is in a child package of theSCM
. - Since:
- 2.3.0
-
supportsDescriptor
Checks if thisSCMFileSystem.Builder
supports the suppliedSCMDescriptor
.- Parameters:
descriptor
- theSCMDescriptor
- Returns:
true
if and only if the suppliedSCMSourceDescriptor
'sSCMDescriptor
class is supported by thisSCMFileSystem.Builder
.- Since:
- 2.3.0
-
supports
Checks if thisSCMFileSystem.Builder
supports 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: theSCMSource
for the descriptor is the enclosing class of this builder class, the builder andSCMSource
are in the same package, or the builder is in a child package of theSCMSource
. - Since:
- 2.3.0
-
supportsDescriptor
Checks if thisSCMFileSystem.Builder
supports the suppliedSCMSourceDescriptor
.- Parameters:
descriptor
- theSCMSourceDescriptor
- Returns:
true
if and only if the suppliedSCMSourceDescriptor
'sSCMSource
class is supported by thisSCMFileSystem.Builder
,false
ifbuild(SCMSource, SCMHead, SCMRevision)
will always returnnull
, andfalse
by 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 aSCM
this should try to build a correspondingSCMFileSystem
instance that reflects the content at the specifiedSCMRevision
. If theSCM
is supported but not for a fixed revision, best effort is acceptable as the most capableSCMFileSystem
will be returned to the caller.- Parameters:
owner
- the owner of theSCM
scm
- theSCM
.rev
- the specifiedSCMRevision
.- Returns:
- the corresponding
SCMFileSystem
ornull
if this builder cannot create aSCMFileSystem
for the specifiedSCM
. - Throws:
IOException
- if the attempt to create aSCMFileSystem
failed due to an IO error (such as the remote system being unavailable)InterruptedException
- if the attempt to create aSCMFileSystem
was interrupted.
-
build
@CheckForNull public SCMFileSystem build(@NonNull SCMSource source, @NonNull SCMHead head, @CheckForNull SCMRevision rev) throws IOException, InterruptedException Given aSCMSource
, aSCMHead
and aSCMRevision
this method should try to build a correspondingSCMFileSystem
instance that reflects the content of the specifiedSCMHead
at the specifiedSCMRevision
. If theSCMSource
is supported but not for a fixed revision, best effort is acceptable as the most capableSCMFileSystem
will be returned to the caller.- Parameters:
source
- theSCMSource
.head
- the specifiedSCMHead
.rev
- the specifiedSCMRevision
.- Returns:
- the corresponding
SCMFileSystem
ornull
if there is none. - Throws:
IOException
- if the attempt to create aSCMFileSystem
failed due to an IO error (such as the remote system being unavailable)InterruptedException
- if the attempt to create aSCMFileSystem
was interrupted.
-
build
@CheckForNull public SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull SCMRevision rev, @CheckForNull Run<?, ?> _build) throws IOException, InterruptedExceptionGiven aSCM
this should try to build a correspondingSCMFileSystem
instance that reflects the content at the specifiedSCMRevision
. If theSCM
is supported but not for a fixed revision, best effort is acceptable as the most capableSCMFileSystem
will be returned to the caller. If theRun
is 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 theSCM
scm
- theSCM
.rev
- the specifiedSCMRevision
._build
- the specifiedRun
.- Returns:
- the corresponding
SCMFileSystem
ornull
if this builder cannot create aSCMFileSystem
for the specifiedSCM
. - Throws:
IOException
- if the attempt to create aSCMFileSystem
failed due to an IO error (such as the remote system being unavailable)InterruptedException
- if the attempt to create aSCMFileSystem
was interrupted.
-