Package jSimMacs.display.dialog

Examples of jSimMacs.display.dialog.EnterInputDialog


        throw new IOException("Login aborted by user");

      File keyFile = new File(kd.getFile());

      if (keyFile.exists()) {
        final EnterInputDialog esd = new EnterInputDialog(JSimLogic
            .getInstance().getFrame(), "Key Authentication",
            new String[] { "Enter private key password" }, true);
        esd.setLocationRelativeTo(JSimLogic.getInstance().getFrame());
        esd.setVisible(true);

        if (esd.getAnswer() == null)
          throw new IOException("Login aborted by user");

        success = conn.authenticateWithPublicKey(
            rProject.getUsername(), keyFile, esd.getAnswer());
      }
    } else if (conn.isAuthMethodAvailable(rProject.getUsername(),
        "keyboard-interactive")) {
      InteractiveLogic il = new InteractiveLogic();
      success = conn.authenticateWithKeyboardInteractive(rProject
          .getUsername(), il);
      if (il.getPromptCount() == 0)
        throw new IOException("Keyboard-interactive does not work.");
    } else if (conn.isAuthMethodAvailable(rProject.getUsername(),
        "password")) {
      final EnterInputDialog esd = new EnterInputDialog(JSimLogic
          .getInstance().getFrame(), "Password Authentication",
          new String[] { "Enter password for "
              + rProject.getUsername() }, true);
      esd.setLocationRelativeTo(JSimLogic.getInstance().getFrame());
      esd.setVisible(true);

      if (esd.getAnswer() == null)
        throw new IOException("Login aborted by user");

      success = conn.authenticateWithPassword(rProject.getUsername(), esd
          .getAnswer());
    }

    if (!success)
      throw new IOException("Authentication failed");
View Full Code Here


//      {
//        /* show lastError only once */
//        lastError = null;
//      }

      EnterInputDialog esd = new EnterInputDialog(JSimLogic.getInstance().getFrame(), "Keyboard Interactive Authentication",
          content, !echo[i]);
      esd.setLocationRelativeTo(JSimLogic.getInstance().getFrame());
      esd.setVisible(true);

      if (esd.getAnswer() == null)
        throw new IOException("Login aborted by user");

      result[i] = esd.getAnswer();
      promptCount++;
    }

    return result;
  }
View Full Code Here

TOP

Related Classes of jSimMacs.display.dialog.EnterInputDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.