org.gcube.datatransformation.datatransformationlibrary.utils
Class CLIUtils
java.lang.Object
org.gcube.datatransformation.datatransformationlibrary.utils.CLIUtils
public class CLIUtils
- extends Object
- Author:
- Dimitris Katris, NKUA
Utility class which facilitates the execution of command line programs.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLIUtils
public CLIUtils()
executeCommand
public static int executeCommand(String command)
throws Exception
- Executes a command in the underlying shell.
- Parameters:
command - The command which will be executed.
- Returns:
- The return code of the executed command.
- Throws:
Exception - If the command could not be performed.
executeCommand
public static int executeCommand(String command,
InputStream input)
throws Exception
- Executes a command in the underlying shell.
- Parameters:
command - The command which will be executed.input - The input stream that should be piped to command execution.
- Returns:
- The return code of the executed command.
- Throws:
Exception - If the command could not be performed.
copyStream
public static void copyStream(InputStream input,
OutputStream output)
throws IOException
- Throws:
IOException
Copyright © 2013. All Rights Reserved.