Package jenkins.scm.api
Class SCMProbe
- java.lang.Object
-
- jenkins.scm.api.SCMSourceCriteria.Probe
-
- jenkins.scm.api.SCMProbe
-
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
public abstract class SCMProbe extends SCMSourceCriteria.Probe implements Closeable
An unmanagedSCMSourceCriteria.Probe
that has its lifecycle managed outside ofSCMSource.fetch(TaskListener)
. ASCMProbe
is used to check and recheckSCMSourceCriteria
so implementations are strongly recommended to provide caching of results fromstat(String)
andSCMSourceCriteria.Probe.lastModified()
.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SCMProbe()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
exists(String path)
Deprecated.usestat(String)
abstract SCMProbeStat
stat(String path)
Checks if the path, relative to the head candidate root, exists or not.-
Methods inherited from class jenkins.scm.api.SCMSourceCriteria.Probe
getRoot, lastModified, name
-
-
-
-
Method Detail
-
exists
@Deprecated public final boolean exists(@NonNull String path) throws IOException
Deprecated.usestat(String)
Checks if the path, relative to the head candidate root, exists or not. The results of this method should be cached where possible but can involve a remote network call.- Specified by:
exists
in classSCMSourceCriteria.Probe
- Parameters:
path
- the path.- Returns:
true
iff the path exists (may be a file or a directory or a symlink or whatever).- Throws:
IOException
- if a remote network call failed and the result is therefore indeterminate.
-
stat
@NonNull public abstract SCMProbeStat stat(@NonNull String path) throws IOException
Checks if the path, relative to the head candidate root, exists or not. The results of this method should be cached where possible but can involve a remote network call.- Overrides:
stat
in classSCMSourceCriteria.Probe
- Parameters:
path
- the path.- Returns:
- The results of the check.
- Throws:
IOException
- if a remote network call failed and the result is therefore indeterminate.
-
-