Package com.atlassian.bamboo.testutils
Class CommandExecutor
- java.lang.Object
-
- com.atlassian.bamboo.testutils.CommandExecutor
-
public class CommandExecutor extends Object
-
-
Constructor Summary
Constructors Constructor Description CommandExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessDescriptorexec(String command)A naive exec method that splits the passed command at each space.ProcessDescriptorexec(String[] command)ProcessDescriptorexec(String[] command, @Nullable File workingDirectory, Duration timeout)ProcessDescriptorstartDaemon(String[] command, Duration timeout)voidstopDaemon(ProcessDescriptor processDescriptor)
-
-
-
Method Detail
-
startDaemon
public ProcessDescriptor startDaemon(String[] command, Duration timeout) throws IOException
- Throws:
IOException
-
stopDaemon
public void stopDaemon(ProcessDescriptor processDescriptor) throws InterruptedException
- Throws:
InterruptedException
-
exec
public ProcessDescriptor exec(String[] command, @Nullable @Nullable File workingDirectory, Duration timeout) throws IOException, TimeoutException, InterruptedException
-
exec
public ProcessDescriptor exec(String[] command) throws TimeoutException, IOException, InterruptedException
-
exec
public ProcessDescriptor exec(String command) throws TimeoutException, IOException, InterruptedException
A naive exec method that splits the passed command at each space. Thus will break if any single value is a space- Parameters:
command-- Throws:
TimeoutExceptionIOExceptionInterruptedException
-
-