Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.util
Class FlexProcess  view FlexProcess download FlexProcess.java

java.lang.Object
  extended bycom.flexstor.common.util.FlexProcess
Direct Known Subclasses:
MacProcess, WinProcess

public class FlexProcess
extends java.lang.Object


Field Summary
protected  boolean bCommand
           
protected static java.lang.String LINE_FEED
           
protected static char PATH_SEPARATOR
           
protected  java.lang.String[] saArguments
           
protected  java.lang.String[] saServerNames
           
protected  java.lang.String sExecName
           
protected static java.lang.String TEMP_FILE
           
 
Constructor Summary
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.
 
Method Summary
static FlexProcess createProcess(java.lang.String sExecName, java.lang.String[] saArguments, java.lang.String[] saServerNames)
           
static FlexProcess createProcess(java.lang.String sExecName, java.lang.String sArgument, java.lang.String sServerName)
          Convenience method for one argument.
 void execute()
          Execute the external process
 java.lang.String getTempFileName()
          Gets the name of the temporary data file.
 java.lang.String getTempFolder()
          Gets the name of the temporary folder.
protected  void prepareArguments()
          Overwritten by subclasses.
 FlexProcess setCommandMode(boolean bCommand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

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.

Method Detail

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