Class Overview
Augments the CommandBuilder
with SCM-related properties, still supporting creating free-form commands.
SCM command builders are specifically intended to be used with binaries such as git
, hg
or
svn
, which provide a variety of different commands, each accepting different arguments and input and
producing different output, to carry out their functionality.
Summary
[Expand]
Inherited Methods |
From interface
com.atlassian.bitbucket.scm.CommandBuilder
@Nonnull
B
|
argument(String argument)
Appends the provided argument, with leading and trailing whitespace trimmed
Note: Arguments must be provided one per invocation.
|
@Nonnull
B
|
argumentAfter(String anchor, String argument)
Inserts the provided argument, with leading and trailing whitespace trimmed, immediately after the
specified anchor if the anchor can be found.
|
@Nonnull
B
|
argumentAt(int index, String argument)
Inserts the provided argument, with leading and trailing whitespace trimmed, at the specified index.
|
@Nonnull
B
|
argumentBefore(String anchor, String argument)
Inserts the provided argument, with leading and trailing whitespace trimmed, immediately before the
specified anchor if the anchor can be found.
|
@Nonnull
B
|
clearArguments()
Clears any arguments which have been set.
|
@Nonnull
B
|
clearInputHandler()
|
@Nonnull
B
|
defaultErrorHandler()
Applies the default error handler , which will collect any output written to the
error stream and provide that output to the exit handler .
|
@Nonnull
B
|
errorHandler(CommandErrorHandler value)
Sets the error handler which will be used to process any output written to the
error stream as the command runs.
|
@Nonnull
B
|
inputHandler(CommandInputHandler value)
Sets the input handler which will be used to feed data to the command's input
stream.
|
@Nonnull
B
|
rawArgument(String argument)
Appends the provided argument, verbatim
Note: Arguments must be provided one per invocation.
|
@Nonnull
B
|
rawArgumentAfter(String anchor, String argument)
Inserts the provided argument, verbatim, immediately after the specified anchor if the anchor can be
found.
|
@Nonnull
B
|
rawArgumentAt(int index, String argument)
Inserts the provided argument, verbatim, at the specified index.
|
@Nonnull
B
|
rawArgumentBefore(String anchor, String argument)
Inserts the provided argument, verbatim, immediately before the specified anchor if the anchor can be
found.
|
|
From interface
com.atlassian.bitbucket.scm.CommandBuilderSupport
|
Public Methods
Builds a Command
which, when executed
, will provide output to the provided
outputHandler
for processing.
If no command
has been set, the first argument is assumed to be the command. For
SCMs with unified binaries that have no default command, if no command has been set and no arguments have
been provided, implementations may throw an exception rather than executing the process which, most
likely, will simply print usage information and exit.
Parameters
outputHandler
| the handler to receive and process output from the command as it executes |
Throws
IllegalStateException
| if no command has been set and no arguments were provided |
NullPointerException
| if the provided outputHandler is null
|
@Nonnull
public
B
command
(String command)
Sets the command to execute.
Most SCMs, such as git
, hg
or svn
, have a single unified binary which expects the
command to run as its first argument. This property separates that special command argument from the others,
allowing other arguments to be cleared
without clearing the command as well.
Parameters
command
| the SCM command to execute |
Throws
IllegalArgumentException
| if the provided command is empty or blank |
NullPointerException
| if the provided command is null
|