Package org.aksw.iguana.commons.script
Class ScriptExecutor
- java.lang.Object
-
- org.aksw.iguana.commons.script.ScriptExecutor
-
public class ScriptExecutor extends java.lang.Object
Class to execute Shell Scripts- Author:
- f.conrads
-
-
Constructor Summary
Constructors Constructor Description ScriptExecutor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
exec(java.lang.String file, java.lang.String[] args)
Will execute the given file with the provided arguments via Shell.static int
execSafe(java.lang.String file, java.lang.String[] args)
Checks if file contains arguments itself
-
-
-
Method Detail
-
exec
public static int exec(java.lang.String file, java.lang.String[] args) throws org.apache.commons.exec.ExecuteException, java.io.IOException
Will execute the given file with the provided arguments via Shell.- Parameters:
file
- file to executeargs
- arguments to execute file with- Returns:
- Process return, 0 means everything worked fine
- Throws:
org.apache.commons.exec.ExecuteException
- if script can't be executedjava.io.IOException
- if file IO errors
-
execSafe
public static int execSafe(java.lang.String file, java.lang.String[] args) throws org.apache.commons.exec.ExecuteException, java.io.IOException
Checks if file contains arguments itself- Parameters:
file
- file to executeargs
- arguments to execute file with- Returns:
- Process return, 0 means everything worked fine
- Throws:
org.apache.commons.exec.ExecuteException
- if script can't be executedjava.io.IOException
- if file IO errors
-
-