org.apache.geronimo.deployment.cli
Class ServerConnection.PasswordPrompt

java.lang.Object
  extended byorg.apache.geronimo.deployment.cli.ServerConnection.PasswordPrompt
All Implemented Interfaces:
Runnable
Enclosing class:
ServerConnection

public static class ServerConnection.PasswordPrompt
extends Object
implements Runnable

Prompts for and grabs a password, trying to suppress any console output along the way. Kind of heavy-handed, but we don't have access to any platform-specific APIs that might make this nicer.


Constructor Summary
ServerConnection.PasswordPrompt(String prompt, PrintWriter out)
           
 
Method Summary
 String getPassword(BufferedReader in)
          Displays the prompt, grabs the password, cleans up, and returns the entered password.
 void run()
          Don't call this directly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerConnection.PasswordPrompt

public ServerConnection.PasswordPrompt(String prompt,
                                       PrintWriter out)
Method Detail

run

public void run()
Don't call this directly.

Specified by:
run in interface Runnable

getPassword

public String getPassword(BufferedReader in)
                   throws IOException
Displays the prompt, grabs the password, cleans up, and returns the entered password. For this to make sense, the input reader here must be part of the same console as the output writer passed to the constructor.

For higher security, should return a char[], but that will just be defeated by the JSR-88 call that takes a String anyway, so why bother?

Throws:
IOException


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.