@NotThreadSafe public interface CommandBuilderSupport<B extends CommandBuilderSupport<B>>
CommandBuilder
s and, for those plugins which choose to provide them, type-safe builders.Modifier and Type | Method and Description |
---|---|
<T> Command<T> |
build(CommandOutputHandler<T> outputHandler)
|
B |
clearEnvironment()
Clears any environment variables which have been set.
|
B |
defaultExitHandler()
Applies the default
CommandExitHandler . |
B |
defaultWorkDir()
Deprecated.
since 7.14 for removal without replacement in 8.0.
|
B |
defaultWorkingDirectory()
Deprecated.
since 7.14 for removal without replacement in 8.0.
|
B |
exitHandler(CommandExitHandler value)
Sets the
CommandExitHandler which should be invoked after the command exits. |
B |
removeEnvironment(String name)
Removes the environment variable with the provided
name if it has been set |
B |
withEnvironment(String name,
String value)
Adds an environment variable with the specified
name and value . |
B |
workDir(Path value)
Deprecated.
since 7.14 for removal in 8.0. Use the Work Tree API instead.
|
B |
workDir(String value)
Deprecated.
since 7.14 for removal in 8.0. Use the Work Tree API instead.
|
B |
workingDirectory(File value)
Deprecated.
in 6.4, for removal in 8.0. Use the Work Tree API instead.
|
B |
workingDirectory(Path value)
Deprecated.
in 6.4, for removal in 8.0. Use the Work Tree API instead.
|
B |
workingDirectory(String value)
Deprecated.
in 6.4, for removal in 8.0. Use the Work Tree API instead.
|
@Nonnull <T> Command<T> build(@Nonnull CommandOutputHandler<T> outputHandler)
Command
which, when executed
, will provide output to the provided
outputHandler
for processing.T
- type for the builderoutputHandler
- the handler to receive and process output from the command as it executesNullPointerException
- if the provided outputHandler
is null
@Nonnull B clearEnvironment()
this
@Nonnull B defaultExitHandler()
CommandExitHandler
. The default exit handler used is based on the builder in play;
each builder is free to define its own default exit handler.
Note: If no explicit exit handler is set
, the default will be applied
automatically when the command is built
; it is not possible to build a
command without an exit handler.
this
@Deprecated @Nonnull B defaultWorkDir()
this
@Deprecated @Nonnull B defaultWorkingDirectory()
this
@Nonnull B exitHandler(@Nonnull CommandExitHandler value)
CommandExitHandler
which should be invoked after the command exits. This handler receives:
Throwable
thrown during processingvalue
- the handler which should be invoked when the command exitsthis
NullPointerException
- if the provided value
is null
@Nonnull B removeEnvironment(@Nonnull String name)
name
if it has been setname
- the name of the environment variable to clearthis
IllegalArgumentException
- if name
is empty or blankNullPointerException
- if name
is null
@Nonnull B withEnvironment(@Nonnull String name, @Nonnull String value)
name
and value
. Both parameters are required,
and an exception will be thrown if either is not provided.name
- the name of the environment variable to setvalue
- the value to set for the environment variablethis
IllegalArgumentException
- if name
or value
is empty or blankNullPointerException
- if name
or value
is null
@Deprecated @Nonnull B workDir(@Nonnull Path value)
value
- the desired working directorythis
IllegalArgumentException
- if value
references a nonexistent path, or a fileNullPointerException
- if the provided value
is null
@Deprecated @Nonnull B workDir(@Nonnull String value)
value
- the desired working directorythis
IllegalArgumentException
- if value
references a nonexistent path, or a fileNullPointerException
- if the provided value
is null
@Deprecated @Nonnull B workingDirectory(@Nonnull File value)
value
- the desired working directorythis
IllegalArgumentException
- if value
references a nonexistent path, or a fileNullPointerException
- if the provided value
is null
@Deprecated @Nonnull B workingDirectory(@Nonnull Path value)
value
- the desired working directorythis
IllegalArgumentException
- if value
references a nonexistent path, or a fileNullPointerException
- if the provided value
is null
@Deprecated @Nonnull B workingDirectory(@Nonnull String value)
value
- the absolute path to the desired working directorythis
IllegalArgumentException
- if value
references a nonexistent path, or a fileNullPointerException
- if the provided value
is null
Copyright © 2022 Atlassian. All rights reserved.