public String getMasterPassword()

in taverna-commandline-common/src/main/java/org/apache/taverna/commandline/CommandLineMasterPasswordProvider.java [61:90]


	public String getMasterPassword(boolean firstTime) {
		if (!finishedReadingPassword) {
			// -cmpassword option was present in the command line arguments
			if (commandLineOptions.hasOption(CREDENTIAL_MANAGER_MASTER_PASSWORD_OPTION)) {
				// Try to read the password from stdin (terminal or pipe)
				try {
					masterPassword = getCredentialManagerPasswordFromStdin();
				} catch (CommandLineMasterPasswordException e) {
					masterPassword = null;
				}
			}
			// -cmpassword option was not present in the command line arguments
			// and -cmdir option was there - try to get the master password from
			// the "special" password file password.txt inside the Cred. Manager directory.
			else {
				if (commandLineOptions.hasOption(CREDENTIAL_MANAGER_DIRECTORY_OPTION)) {
					// Try to read the password from a special file located in
					// Credential Manager directory (if the dir was not null)
					try {
						masterPassword = getCredentialManagerPasswordFromFile();
					} catch (CommandLineMasterPasswordException ex) {
						masterPassword = null;
					}
				}
			}
			finishedReadingPassword = true; // we do not want to attempt to read from stdin several
											// times
		}
		return masterPassword;
	}