Class CLIUtil


  • public class CLIUtil
    extends Object
    This is an utility class.
    • Method Detail

      • getFileContent

        public static String getFileContent​(CommandManager mgr,
                                            String fileName)
                                     throws CLIException
        Returns content of a file.
        Parameters:
        mgr - Command Line Manager.
        fileName - Name of file.
        Returns:
        content of a file.
        Throws:
        CLIException - if file content cannot be returned.
      • getFileContent

        public static String getFileContent​(CommandManager mgr,
                                            String fileName,
                                            boolean singleLine)
                                     throws CLIException
        Returns content of a file.
        Parameters:
        mgr - Command Line Manager.
        fileName - Name of file.
        singleLine - true to only read one line from the file.
        Returns:
        content of a file.
        Throws:
        CLIException - if file content cannot be returned.
      • getPasswordFields

        public static Set getPasswordFields​(String serviceName)
                                     throws SMSException,
                                            SSOException
        Returns a set of attributes (of password syntax) of a given service.
        Parameters:
        serviceName - Name of service.
        Returns:
        a set of attributes (of password syntax) of a given service.
        Throws:
        SMSException - if error occurs when reading the service schema layer
        SSOException - if Single sign-on token is invalid.
      • getPasswordFields

        public static Set getPasswordFields​(String serviceName,
                                            SchemaType schemaType,
                                            String subSchema)
                                     throws SMSException,
                                            SSOException
        Returns a set of attributes (of password syntax) of a given service.
        Parameters:
        serviceName - Name of service.
        schemaType - Type of Schema.
        subSchema - Name of SubSchema
        Returns:
        a set of attributes (of password syntax) of a given service.
        Throws:
        SMSException - if error occurs when reading the service schema layer
        SSOException - if Single sign-on token is invalid.
      • writeToFile

        public static void writeToFile​(String file,
                                       String content)
                                throws IOException
        Writes to a file.
        Parameters:
        file - Name of file.
        content - Content to be written.
        Throws:
        IOException - if file cannot be accessed.