Class Util


  • public class Util
    extends Object
    Util.
    Version:
    $Revision: 1.1 $
    Author:
    Scott.Stark@jboss.org, Adrian Brock
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • loadPassword

        public static char[] loadPassword​(String passwordCmd)
                                   throws Exception
        Execute a password load command to obtain the char[] contents of a password.
        Parameters:
        passwordCmd - - A command to execute to obtain the plaintext password. The format is one of: '{EXT}...' where the '...' is the exact command '{EXTC[:expiration_in_millis]}...' where the '...' is the exact command line that will be passed to the Runtime.exec(String) method to execute a platform command. The first line of the command output is used as the password. EXTC variant will cache the passwords for expiration_in_millis milliseconds. Default cache expiration is 0 = infinity. '{CMD}...' or '{CMDC[:expiration_in_millis]}...' for a general command to execute. The general command is a string delimited by ',' where the first part is the actual command and further parts represents its parameters. The comma can be backslashed in order to keep it as a part of the parameter. '{CLASS[@jboss_module_spec]}classname[:ctorargs]' where the '[:ctorargs]' is an optional string delimited by the ':' from the classname that will be passed to the classname ctor. The ctorargs itself is a comma delimited list of strings. The jboss_module is JBoss Modules module identifier to load the CLASS from. The password is obtained from classname by invoking a 'char[] toCharArray()' method if found, otherwise, the 'String toString()' method is used.
        Returns:
        the password characters
        Throws:
        Exception
      • isPasswordCommand

        public static boolean isPasswordCommand​(String passwordCmd)
        Checks whether password can be loaded by loadPassword(String).
        Parameters:
        passwordCmd - a potential password command
        Returns:
        true if password can be loaded by loadPassword(String), false otherwise.
      • isPasswordCommand

        public static boolean isPasswordCommand​(char[] passwordCmd)
        Checks whether password can be loaded by loadPassword(String).
        Parameters:
        passwordCmd - a potential password command
        Returns:
        true if password can be loaded by loadPassword(String), false otherwise.