|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.izforge.izpack.util.FileExecutor
public class FileExecutor
Executes a bunch of files. This class is intended to do a system dependent installation postprocessing. Executable file can be any file installed with current package. After execution the file can be optionally removed. Before execution on Unix systems execution flag will be set on processed file.
Field Summary | |
---|---|
private java.util.Collection<ExecutableFile> |
files
The files to execute. |
private static java.lang.String |
JAR_FILE_SUFFIX
|
Constructor Summary | |
---|---|
FileExecutor()
Constructs a new executor. |
|
FileExecutor(java.util.Collection<ExecutableFile> files)
Constructs a new executor. |
Method Summary | |
---|---|
private java.lang.String |
buildClassPath(java.lang.String targetFile)
Transform classpath as specified in targetFile attribute into OS specific classpath. |
int |
executeCommand(java.lang.String[] params,
java.lang.String[] output)
Executed a system command and waits for completion. |
int |
executeFiles(int currentStage,
AbstractUIHandler handler)
Executes files specified at construction time. |
static java.lang.String |
getExecOutput(java.lang.String[] aCommandLine)
Gets the output of the given (console based) commandline |
static java.lang.String |
getExecOutput(java.lang.String[] aCommandLine,
boolean forceToGetStdOut)
Executes the given Command and gets the result of StdOut, or if exec returns ! |
private boolean |
stopThread(java.lang.Thread t,
MonitorInputStream m)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String JAR_FILE_SUFFIX
private java.util.Collection<ExecutableFile> files
Constructor Detail |
---|
public FileExecutor(java.util.Collection<ExecutableFile> files)
files
- the executable files to processpublic FileExecutor()
Method Detail |
---|
private boolean stopThread(java.lang.Thread t, MonitorInputStream m)
public static java.lang.String getExecOutput(java.lang.String[] aCommandLine)
aCommandLine
- to execute
public static java.lang.String getExecOutput(java.lang.String[] aCommandLine, boolean forceToGetStdOut)
aCommandLine
- aCommandLine to executeforceToGetStdOut
- if true returns stdout
public int executeCommand(java.lang.String[] params, java.lang.String[] output)
params
- system command as string arrayoutput
- contains output of the command index 0 = standard output index 1 = standard
error
public int executeFiles(int currentStage, AbstractUIHandler handler)
currentStage
- the stage of the installationhandler
- The AbstractUIHandler to notify on errors.
private java.lang.String buildClassPath(java.lang.String targetFile) throws java.lang.Exception
targetFile
-
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |