}
public void addUserPrincipal(Hashtable properties)
throws GeronimoSecurityException {
if (users.getProperty((String) properties.get("UserName")) != null) {
throw new GeronimoSecurityException("User principal "
+ properties.get("UserName") + " already exists.");
}
try {
refreshUsers();
String digest = getDigest();
String user = (String) properties.get("UserName");
String password = (String) properties.get("Password");
if(digest != null && !digest.equals("")) {
password = digestPassword(password, digest);
}
users.setProperty(user, password);
store(users, serverInfo.resolveServer(getUsersURI()).toURL());
} catch (Exception e) {
throw new GeronimoSecurityException("Cannot add user principal: "
+ e.getMessage());
}
}