* @see User#changePassword(String, String)
*/
public void changePassword(String password, String oldPassword) throws RepositoryException {
// make sure the old password matches.
try {
CryptedSimpleCredentials csc = (CryptedSimpleCredentials) getCredentials();
SimpleCredentials creds = new SimpleCredentials(getID(), oldPassword.toCharArray());
if (!csc.matches(creds)) {
throw new RepositoryException("Failed to change password: Old password does not match.");
}
} catch (NoSuchAlgorithmException e) {
throw new RepositoryException("Cannot change password: failed to validate old password.");
} catch (UnsupportedEncodingException e) {