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 StringinvokeExecutable(String commandline)Executes the given command on the commandline and returns the complete output.static StringinvokeExecutable(String commandline, long maxLines)static StringinvokeExecutable(String commandline, long maxLines, boolean suppressErrors)Executes the given command on the commandline and returns the output up to a given number of lines.Stringrun(String cmd)runs command-
Methods inherited from class net.sf.tweety.commons.util.Shell
getCygwinShell, getNativeShell
-
-
-
-
Method Detail
-
run
public String run(String cmd) throws InterruptedException, IOException
Description copied from class:Shellruns command- Specified by:
runin classShell- Parameters:
cmd- the command to be run- Returns:
- the terminal output
- Throws:
InterruptedException- if some interruption occurred.IOException- if some IO issue occurred.
-
invokeExecutable
public static String invokeExecutable(String commandline) throws IOException, InterruptedException
Executes the given command on the commandline and returns the complete output.- Parameters:
commandline- some command- Returns:
- the output of the execution
- Throws:
IOException- of an error was encountered.InterruptedException- if some interruption occurred.
-
invokeExecutable
public static String invokeExecutable(String commandline, long maxLines) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
invokeExecutable
public static String invokeExecutable(String commandline, long maxLines, boolean suppressErrors) throws IOException, 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:
IOException- of an error was encountered.InterruptedException- if some interruption occurred.
-
-