java.lang.Object
com.flexstor.common.util.FlexProcess
- Direct Known Subclasses:
- MacProcess, WinProcess
- public class FlexProcess
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEMP_FILE
protected static final java.lang.String TEMP_FILE
- See Also:
- Constant Field Values
LINE_FEED
protected static final java.lang.String LINE_FEED
PATH_SEPARATOR
protected static final char PATH_SEPARATOR
sExecName
protected java.lang.String sExecName
saArguments
protected java.lang.String[] saArguments
saServerNames
protected java.lang.String[] saServerNames
bCommand
protected boolean bCommand
FlexProcess
protected FlexProcess(java.lang.String sExecName,
java.lang.String[] saArguments,
java.lang.String[] saServerNames)
- This constructor takes an executable name and an array of Strings
as arguments. The argument array will be prepared for each specific
platform, i.e.
Win: prepend server name to create a UNC path
Mac: write to temporary file to feed into AppleSript
Other: nothing
the server name is required to create a UNC name for Windows platforms.
The class then call Runtime.exec() to create the new process.
getTempFolder
public java.lang.String getTempFolder()
- Gets the name of the temporary folder. Defaults to path of
executable if subclasses do not override this method.
getTempFileName
public java.lang.String getTempFileName()
- Gets the name of the temporary data file. Defaults to path of
executable if subclasses do not override this method.
setCommandMode
public FlexProcess setCommandMode(boolean bCommand)
prepareArguments
protected void prepareArguments()
throws java.io.IOException
- Overwritten by subclasses.
Responsibilty is to modify the argument array for the specific platform.
createProcess
public static FlexProcess createProcess(java.lang.String sExecName,
java.lang.String sArgument,
java.lang.String sServerName)
- Convenience method for one argument.
createProcess
public static FlexProcess createProcess(java.lang.String sExecName,
java.lang.String[] saArguments,
java.lang.String[] saServerNames)
execute
public void execute()
throws java.io.IOException
- Execute the external process