Class 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)
    • Constructor Detail

      • Terminal

        public Terminal()
    • 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