Package net.sf.tweety.commons.util
Class NativeShell
- java.lang.Object
-
- net.sf.tweety.commons.util.Shell
-
- net.sf.tweety.commons.util.NativeShell
-
public class NativeShell extends Shell
Default shell- Author:
- Nils Geilen, Matthias Thimm
-
-
Method Summary
Modifier and Type Method Description static java.lang.String
invokeExecutable(java.lang.String commandline)
Executes the given command on the commandline and returns the complete output.static java.lang.String
invokeExecutable(java.lang.String commandline, long maxLines)
static java.lang.String
invokeExecutable(java.lang.String commandline, long maxLines, boolean suppressErrors)
Executes the given command on the commandline and returns the output up to a given number of lines.java.lang.String
run(java.lang.String cmd)
runs command-
Methods inherited from class net.sf.tweety.commons.util.Shell
getCygwinShell, getNativeShell
-
-
-
-
Method Detail
-
run
public java.lang.String run(java.lang.String cmd) throws java.lang.InterruptedException, java.io.IOException
Description copied from class:Shell
runs command
-
invokeExecutable
public static java.lang.String invokeExecutable(java.lang.String commandline) throws java.io.IOException, java.lang.InterruptedException
Executes the given command on the commandline and returns the complete output.- Parameters:
commandline
- some command- Returns:
- the output of the execution
- Throws:
java.io.IOException
- of an error was encountered.java.lang.InterruptedException
- if some interruption occurred.
-
invokeExecutable
public static java.lang.String invokeExecutable(java.lang.String commandline, long maxLines) throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
invokeExecutable
public static java.lang.String invokeExecutable(java.lang.String commandline, long maxLines, boolean suppressErrors) throws java.io.IOException, java.lang.InterruptedException
Executes the given command on the commandline and returns the output up to a given number of lines.- Parameters:
commandline
- some commandmaxLines
- the maximum number of lines to be read (the process is killed afterwards)suppressErrors
- if set to true, possible errors will not be included in the output- Returns:
- the output of the execution
- Throws:
java.io.IOException
- of an error was encountered.java.lang.InterruptedException
- if some interruption occurred.
-
-