* @param users
* @param props
*/
TreeMap<String, User> loadUsersFromProperties(Properties props) {
TreeMap<String, User> users = new TreeMap<String, User>();
UserAttributeEditor configAttribEd = new UserAttributeEditor();
for (Iterator iter = props.keySet().iterator(); iter.hasNext();) {
// the attribute editors parses the list of strings into password, username and enabled
// flag
String username = (String) iter.next();
configAttribEd.setAsText(props.getProperty(username));
// if the parsing succeeded turn that into a user object
UserAttribute attr = (UserAttribute) configAttribEd.getValue();
if (attr != null) {
User user = createUserObject(username, attr.getPassword(), attr.isEnabled(), attr.getAuthorities());
users.put(username, user);
}
}