public interface PasswordPrompter
| Modifier and Type | Method and Description |
|---|---|
boolean |
passwordsMatch(char[] password1,
char[] password2)
Checks whether the two passwords match.
|
char[] |
promptForValidPassword(int minLength,
int maxLength,
String what)
Prompts for a valid password by asking for the password using
readPassword(String, Object...), checking
its length against the constraints, asking for the password to be confirmed, and checking to make sure the
passwords match. |
char[] |
promptForValidPassword(int minLength,
int maxLength,
String promptMessage,
String promptConfirmMessage,
String lengthError,
String matchError,
OutputDevice device)
Prompts for a valid password by asking for the password using
readPassword(String, Object...), checking
its length against the constraints, asking for the password to be confirmed, and checking to make sure the
passwords match. |
char[] |
readPassword()
Reads a password or passphrase from the device with echoing disabled.
|
char[] |
readPassword(String format,
Object... arguments)
Provides a formatted prompt, then reads a password or passphrase from the device with echoing disabled.
|
char[] readPassword()
throws IOError
null if an end of stream has been reached.IOError - if an I/O error occurs.char[] readPassword(String format, Object... arguments) throws IllegalFormatException, IOError
format - A format string as described in #syntaxarguments - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.null if an end of stream has been reached.IllegalFormatException - if a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.IOError - if an I/O error occurs.boolean passwordsMatch(char[] password1,
char[] password2)
password1 - The entered passwordpassword2 - The confirmed passwordtrue if the passwords match, false otherwise.char[] promptForValidPassword(int minLength,
int maxLength,
String promptMessage,
String promptConfirmMessage,
String lengthError,
String matchError,
OutputDevice device)
throws IOError
readPassword(String, Object...), checking
its length against the constraints, asking for the password to be confirmed, and checking to make sure the
passwords match.minLength - The minimum legal length for the passwordmaxLength - The maximum legal length for the passwordpromptMessage - The message to prompt for the password initially (the message should not include format specifiers)promptConfirmMessage - The message to prompt to confirm the password (the message should not include format specifiers)lengthError - The message to display if the password does not meet the minimum or maximum length requirements (the message should not include format specifiers)matchError - The message to display if the two entered passwords do not match (the message should not include format specifiers)device - The device that should be used to output messages and errorsIOError - if an I/O error occurs.char[] promptForValidPassword(int minLength,
int maxLength,
String what)
throws IOError
readPassword(String, Object...), checking
its length against the constraints, asking for the password to be confirmed, and checking to make sure the
passwords match.minLength - The minimum legal length for the passwordmaxLength - The maximum legal length for the passwordwhat - What we're prompting for a password forIOError - if an I/O error occurs.Copyright © 2010-2013 NWTS Java Code. All Rights Reserved. Licensed Under the Apache License version 2.0.