Examples of PasswordSafe


Examples of com.intellij.ide.passwordSafe.PasswordSafe

      int colonIndex = hostAndPort.indexOf(':');
      String host = hostAndPort.substring(0, colonIndex);
            String port = hostAndPort.substring(colonIndex + 1);

            PasswordSafe passwordSafe = PasswordSafe.getInstance();
            final UserAndPassword userAndPassword = getUsernameAndPassword(hostAndPort);
            if (userAndPassword == null) return;
      if (userAndPassword.user == null || userAndPassword.password == null) {
        continue;
      }
      SiConnectCommand command =
          new SiConnectCommand(MksVcs.getInstance(myProject), host, port, userAndPassword.user, userAndPassword.password);
      command.execute();
      if (!command.foundError() && (command.getServer() != null)) {
        servers.add(command.getServer());
                try {
                    MksConfiguration configuration = ApplicationManager.getApplication().getComponent(MksConfiguration.class);
                    configuration.addRememberedUsername(hostAndPort, userAndPassword.user);
                    passwordSafe.storePassword(myProject,  MksVcs.class, createPasswordKey(hostAndPort, userAndPassword.user),userAndPassword.password);
                } catch (PasswordSafeException e) {
                    reportErrors(Arrays.asList(new VcsException(e)), "unable to store credentials");
                }
            } else {
        reportErrors(command.errors, "unable to connect to " + hostAndPort);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.