Package main.utils.ui

Class PasswordReader

java.lang.Object
main.utils.ui.PasswordReader

public class PasswordReader extends Object
The PasswordReader class is responsible for reading a password from the console. It provides a method to read the password securely from the console, and returns the password as a String.
  • Constructor Details

    • PasswordReader

      public PasswordReader()
  • Method Details

    • getPassword

      public static String getPassword()
      Reads a password from the console. If the console is not available, the password is read using a Scanner from System.in. Otherwise, the password is read securely using System.console().readPassword().
      Returns:
      The password read from the console as a String.