Package jenkins.scm.api
Class SCMSourceCriteria.Probe
java.lang.Object
jenkins.scm.api.SCMSourceCriteria.Probe
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SCMProbe
- Enclosing interface:
- SCMSourceCriteria
A probe for a branch candidate. Inspectors can tell whether a file path exists.
Implement
SCMProbe not this- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanDeprecated.getRoot()Returns theSCMFileof the root of this head candidate if such deep introspection can be cheaply provided by the version control system in question.abstract longReturns the time that the potential head was last modified.abstract Stringname()Returns the name of the potential head.Checks if the path, relative to the head candidate root, exists or not.
-
Constructor Details
-
Probe
public Probe()
-
-
Method Details
-
name
Returns the name of the potential head.- Returns:
- the name of the potential head.
-
lastModified
public abstract long lastModified()Returns the time that the potential head was last modified.- Returns:
- A
longvalue representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)
-
exists
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.- Parameters:
path- the path.- Returns:
trueiff 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
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.- Parameters:
path- the path.- Returns:
- The results of the check.
- Throws:
IOException- if a remote network call failed and the result is therefore indeterminate.- Since:
- 2.0
-
getRoot
Returns theSCMFileof the root of this head candidate if such deep introspection can be cheaply provided by the version control system in question.When available, this provides more capabilities to analyze what's in the repository. Given the frequency of
SCMSourceCriteria.isHead(SCMSourceCriteria.Probe, hudson.model.TaskListener)call, this method needs to be used with caution.- Returns:
- the
SCMFileof the root of this head candidate ornullif this is not available.
-
stat(String)