Package com.sun.identity.cli
Class CLIUtil
- java.lang.Object
-
- com.sun.identity.cli.CLIUtil
-
public class CLIUtil extends Object
This is an utility class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getFileContent(CommandManager mgr, String fileName)
Returns content of a file.static String
getFileContent(CommandManager mgr, String fileName, boolean singleLine)
Returns content of a file.static Set
getPasswordFields(String serviceName)
Returns a set of attributes (of password syntax) of a given service.static Set
getPasswordFields(String serviceName, SchemaType schemaType, String subSchema)
Returns a set of attributes (of password syntax) of a given service.static void
writeToFile(String file, String content)
Writes to a file.
-
-
-
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 layerSSOException
- 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 layerSSOException
- 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.
-
-