public class ConsolePasswordFinder extends java.lang.Object implements PasswordFinder
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_FORMAT |
| Constructor and Description |
|---|
ConsolePasswordFinder() |
ConsolePasswordFinder(java.io.Console console) |
ConsolePasswordFinder(java.io.Console console,
java.lang.String promptFormat,
int maxTries) |
| Modifier and Type | Method and Description |
|---|---|
char[] |
reqPassword(Resource<?> resource)
Request password for specified resource.
|
boolean |
shouldRetry(Resource<?> resource)
If password turns out to be incorrect, indicates whether another call to
PasswordFinder.reqPassword(Resource) should be
made. |
public static final java.lang.String DEFAULT_FORMAT
public ConsolePasswordFinder()
public ConsolePasswordFinder(java.io.Console console)
public ConsolePasswordFinder(java.io.Console console,
java.lang.String promptFormat,
int maxTries)
public char[] reqPassword(Resource<?> resource)
PasswordFindernull when the request cannot be serviced, e.g. when the user cancels a password
prompt.reqPassword in interface PasswordFinderresource - the resource for which password is being requestednullpublic boolean shouldRetry(Resource<?> resource)
PasswordFinderPasswordFinder.reqPassword(Resource) should be
made.
This method is geared at interactive implementations, and stub implementations may simply return false.shouldRetry in interface PasswordFinderresource - the resource for which password is being requested