/** * Return the value associated with the {@code password} key, if it is * explicitly defined in the prefs file. Unlike the {@link #getPassword()} * method, this one will not return the default password if one is not * explicitly defined in the file. * <p> * <strong>NOTE</strong>: This method returns the password as a char array * so that the caller can null out the data immediately after use. This is * generally advised to limit the amount of time that the sensitive data * remains in memory. * </p> * * @return the password or an empty character array if it is not defined */ public char[] getPasswordExplicit() { String password = get("password"); if(password != null) { return password.toCharArray(); } else { return NO_PASSWORD_DEFINED; } }