Class CLIUtil


  • public class CLIUtil
    extends Object
    CLI Utility class
    • Field Detail

      • LOGGER

        protected static final Logger LOGGER
    • Constructor Detail

      • CLIUtil

        public CLIUtil()
    • Method Detail

      • readPasswordFileOptions

        public static Map<String,​String> readPasswordFileOptions​(String passwordFileName,
                                                                       boolean withPrefix)
                                                                throws CommandException
        Read passwords from the password file and save them in a java.util.Map.
        Parameters:
        passwordFileName - password file name
        withPrefix - decides whether prefix should be taken into account
        Returns:
        Map of the password name and value
        Throws:
        CommandException
      • getAllCommands

        public static String[] getAllCommands​(CLIContainer container,
                                              ProgramOptions options,
                                              Environment env)
        Return all commands, local and remote.
        Parameters:
        container -
        options - Options to get the command i.e. admin port
        env -
        Returns:
        the commands as a String array, sorted
      • getLocalCommands

        public static String[] getLocalCommands​(CLIContainer container)
        Get all the known local commands.
        Parameters:
        container -
        Returns:
        the commands as a String array, sorted
      • writeCommandToDebugLog

        public static void writeCommandToDebugLog​(String cname,
                                                  Environment env,
                                                  String[] args,
                                                  int exit)
        Log the command, for debugging.
        Parameters:
        cname -
        env -
        args -
        exit -