|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPasswordReader.StreamMasker
public static class PasswordReader.StreamMasker
Masks an InputStream by overwriting blank chars to the PrintStream corresponding to its output. A typical application is for password input masking.
| Constructor Summary | |
|---|---|
PasswordReader.StreamMasker(java.io.PrintStream out,
java.lang.String prompt)
Constructor. |
|
| Method Summary | |
|---|---|
void |
run()
Repeatedly overwrites the current line of out with prompt followed by blanks. |
void |
stop()
Signals any thread executing run to stop masking and exit run. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PasswordReader.StreamMasker(java.io.PrintStream out,
java.lang.String prompt)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if out == null; prompt == null; prompt contains the char '\r' or '\n'| Method Detail |
|---|
public void run()
throws java.lang.RuntimeException
To help ensure that masking occurs when system is in heavy use, the calling thread will have its priority boosted to the max for the duration of the call (with its original priority restored upon return). Interrupting the calling thread will eventually result in an exit from this method, and the interrupted status of the calling thread will be set to true.
run in interface java.lang.Runnablejava.lang.RuntimeException - if an error in the masking process is detectedpublic void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||