Package adams.core.management
Class Terminal
- java.lang.Object
-
- adams.core.management.Terminal
-
public class Terminal extends Object
Handles the terminal setup and can launch a terminal.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILENAMEthe properties file.static StringLINUX_EXECUTABLEthe key for the Linux executable.static StringLINUX_OPTIONSthe key for the Linux options.protected static Propertiesm_Propertiesthe properties.static StringMAC_EXECUTABLEthe key for the Mac executable.static StringMAC_OPTIONSthe key for the Mac options.static StringPLACEHOLDR_DIRthe placeholder for the directory.static StringWINDOWS_EXECUTABLEthe key for the Windows executable.static StringWINDOWS_OPTIONSthe key for the Windows options.
-
Constructor Summary
Constructors Constructor Description Terminal()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetCommand(File dir)Returns the platform-specific executable with its expanded options.static StringgetExecutable()Returns the platform-specific executable.static StringgetLinuxExecutable()Returns the Linux executable.static StringgetLinuxOptions()Returns the Linux options.static StringgetMacExecutable()Returns the Mac executable.static StringgetMacOptions()Returns the Mac options.static StringgetOptions()Returns the platform-specific options.static PropertiesgetProperties()Returns the properties.static StringgetWindowsExecutable()Returns the windows executable.static StringgetWindowsOptions()Returns the windows options.static booleanlaunch(File dir)Launches the platform-specific executable with its expanded options.protected static StringreplaceCurrentDir(String cmd, File dir)Replaces the placeholder for the current directory in the command with the directory presented by this file object.static booleanwriteProperties()Writes the properties to disk.static booleanwriteProperties(Properties props)Writes the specified properties to disk.
-
-
-
Field Detail
-
FILENAME
public static final String FILENAME
the properties file.- See Also:
- Constant Field Values
-
LINUX_EXECUTABLE
public static final String LINUX_EXECUTABLE
the key for the Linux executable.- See Also:
- Constant Field Values
-
LINUX_OPTIONS
public static final String LINUX_OPTIONS
the key for the Linux options.- See Also:
- Constant Field Values
-
MAC_EXECUTABLE
public static final String MAC_EXECUTABLE
the key for the Mac executable.- See Also:
- Constant Field Values
-
MAC_OPTIONS
public static final String MAC_OPTIONS
the key for the Mac options.- See Also:
- Constant Field Values
-
WINDOWS_EXECUTABLE
public static final String WINDOWS_EXECUTABLE
the key for the Windows executable.- See Also:
- Constant Field Values
-
WINDOWS_OPTIONS
public static final String WINDOWS_OPTIONS
the key for the Windows options.- See Also:
- Constant Field Values
-
PLACEHOLDR_DIR
public static final String PLACEHOLDR_DIR
the placeholder for the directory.- See Also:
- Constant Field Values
-
m_Properties
protected static Properties m_Properties
the properties.
-
-
Method Detail
-
getProperties
public static Properties getProperties()
Returns the properties.- Returns:
- the properties
-
writeProperties
public static boolean writeProperties()
Writes the properties to disk.- Returns:
- true if successfully stored
-
writeProperties
public static boolean writeProperties(Properties props)
Writes the specified properties to disk.- Parameters:
props- the properties to write to disk- Returns:
- true if successfully stored
-
getWindowsExecutable
public static String getWindowsExecutable()
Returns the windows executable.- Returns:
- the executable
-
getLinuxExecutable
public static String getLinuxExecutable()
Returns the Linux executable.- Returns:
- the executable
-
getMacExecutable
public static String getMacExecutable()
Returns the Mac executable.- Returns:
- the executable
-
getExecutable
public static String getExecutable()
Returns the platform-specific executable.- Returns:
- the executable
-
getWindowsOptions
public static String getWindowsOptions()
Returns the windows options.- Returns:
- the options
-
getLinuxOptions
public static String getLinuxOptions()
Returns the Linux options.- Returns:
- the options
-
getMacOptions
public static String getMacOptions()
Returns the Mac options.- Returns:
- the options
-
getOptions
public static String getOptions()
Returns the platform-specific options.- Returns:
- the options
-
replaceCurrentDir
protected static String replaceCurrentDir(String cmd, File dir)
Replaces the placeholder for the current directory in the command with the directory presented by this file object. If the file object points to a file, the parent directory is used in the replacement.- Parameters:
cmd- the command to process- Returns:
- the processed command
- See Also:
PLACEHOLDR_DIR
-
getCommand
public static String getCommand(File dir)
Returns the platform-specific executable with its expanded options.- Parameters:
dir- the directory to use in the command; if pointing to a file the parent directory is used- Returns:
- the executable
- See Also:
PLACEHOLDR_DIR
-
launch
public static boolean launch(File dir)
Launches the platform-specific executable with its expanded options.- Parameters:
dir- the directory to use in the command; if pointing to a file the parent directory is used- See Also:
PLACEHOLDR_DIR
-
-