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 String
FILENAME
the properties file.static String
LINUX_EXECUTABLE
the key for the Linux executable.static String
LINUX_OPTIONS
the key for the Linux options.protected static Properties
m_Properties
the properties.static String
MAC_EXECUTABLE
the key for the Mac executable.static String
MAC_OPTIONS
the key for the Mac options.static String
PLACEHOLDR_DIR
the placeholder for the directory.static String
WINDOWS_EXECUTABLE
the key for the Windows executable.static String
WINDOWS_OPTIONS
the 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 String
getCommand(File dir)
Returns the platform-specific executable with its expanded options.static String
getExecutable()
Returns the platform-specific executable.static String
getLinuxExecutable()
Returns the Linux executable.static String
getLinuxOptions()
Returns the Linux options.static String
getMacExecutable()
Returns the Mac executable.static String
getMacOptions()
Returns the Mac options.static String
getOptions()
Returns the platform-specific options.static Properties
getProperties()
Returns the properties.static String
getWindowsExecutable()
Returns the windows executable.static String
getWindowsOptions()
Returns the windows options.static boolean
launch(File dir)
Launches the platform-specific executable with its expanded options.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.static boolean
writeProperties()
Writes the properties to disk.static boolean
writeProperties(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
-
-