|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.unboundid.util.PasswordReader
@ThreadSafety(level=NOT_THREADSAFE) public final class PasswordReader
This class provides a mechanism for reading a password from the command line
in a way that attempts to prevent it from being displayed. If it is
available (i.e., Java SE 6 or later), the
java.io.Console.readPassword
method will be used to accomplish this.
For Java SE 5 clients, a more primitive approach must be taken, which
requires flooding standard output with backspace characters using a
high-priority thread. This has only a limited effectiveness, but it is the
best option available for older Java versions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
static byte[] |
readPassword()
Reads a password from the console. |
void |
run()
Repeatedly sends backspace and space characters to standard output in an attempt to try to hide what the user enters. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static byte[] readPassword() throws LDAPException
LDAPException
- If a problem is encountered while trying to read
the password.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |