mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Violette Roche-Montane
06.18.2014 56f361f30deec1a6d3579bcc32607fe5b12ca636
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ConsoleApplication.java
@@ -36,6 +36,7 @@
import java.io.BufferedReader;
import java.io.Console;
import java.io.EOFException;
import java.io.IOError;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -494,6 +495,27 @@
    }
    /**
     * Reads a password from the console without echoing it to the client.
     * FIXME This method should disappear when all
     * the tools will extend to ConsoleApplication.
     *
     * @return The password as an array of characters.
     * @throws ClientException
     *             If an error occurs when reading the password.
     */
    public static final char[] readPassword() throws ClientException {
        try {
            char[] password = System.console().readPassword();
            if (password != null) {
                return password;
            }
        } catch (IOError e) {
            throw ClientException.adaptInputException(e);
        }
        return null;
    }
    /**
     * Interactively retrieves a line of input from the console.
     *
     * @param prompt