package email;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PasswordAuthenticatedEmailApp extends SecureEmailApp {

  private static final String TOP_SECRET_PASSWORD = "password";

  @Override
  protected boolean checkIdentity(String userId) {
    System.out.println("Enter your password:");
    try {
      String password = new BufferedReader(new InputStreamReader(System.in)).readLine();
      return password.equals(TOP_SECRET_PASSWORD);
    } catch (IOException e) {
      return false;
    }
  }

}
