public class RuntimeUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RuntimeUtil.Response |
Constructor and Description |
---|
RuntimeUtil() |
Modifier and Type | Method and Description |
---|---|
static RuntimeUtil.Response |
execute(String... command)
Executes an external command and provides results of execution.
|
static RuntimeUtil.Response |
execute(String command)
Convenience method, does the same as
execute(String...) , but will
automatically convert a full command string to tokens for convenience. |
static void |
main(String[] args) |
public static RuntimeUtil.Response execute(String... command)
command
- array containing the command to call and its arguments.RuntimeUtil.Response
with result of execution.public static RuntimeUtil.Response execute(String command)
execute(String...)
, but will
automatically convert a full command string to tokens for convenience.
Here is how to call:
System.out.println(execute("ls -ls").out);
command
- - a single string representing a command and its arguments.RuntimeUtil.Response
with result of execution.public static void main(String[] args)
Copyright © 2019 JavaLite. All rights reserved.