org.sonar.api.utils.command
Class CommandExecutor
java.lang.Object
org.sonar.api.utils.command.CommandExecutor
public class CommandExecutor
- extends Object
Synchronously execute a native command line. It's much more limited than the Apache Commons Exec library.
For example it does not allow to run asynchronously or to automatically quote command-line arguments.
- Since:
- 2.7
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
create
public static CommandExecutor create()
execute
public int execute(Command command,
StreamConsumer stdOut,
StreamConsumer stdErr,
long timeoutMilliseconds)
- Throws:
TimeoutException
- on timeout, since 4.4
CommandException
- on any other error- Since:
- 3.0
execute
public int execute(Command command,
long timeoutMilliseconds)
- Execute command and display error and output streams in log.
Method
execute(Command, StreamConsumer, StreamConsumer, long)
is preferable,
when fine-grained control of output of command required.
- Throws:
CommandException
Copyright © 2009–2015 SonarSource. All rights reserved.