Package org.aksw.iguana.commons.script
Class ScriptExecutor
- java.lang.Object
-
- org.aksw.iguana.commons.script.ScriptExecutor
-
public class ScriptExecutor extends java.lang.ObjectClass 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 intexec(java.lang.String file, java.lang.String[] args)Will execute the given file with the provided arguments via Shell.static intexecSafe(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.IOExceptionWill 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.IOExceptionChecks 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
-
-