Package org.acegisecurity.userdetails.memory

Examples of org.acegisecurity.userdetails.memory.UserAttributeEditor


     * @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);
            }
        }
View Full Code Here


  private void update() {
    try {
      if (myWatcher == null) {
      } else if (myWatcher.isStale()) {
  Properties prop = myWatcher.getProperties();
  UserAttributeEditor uae = new UserAttributeEditor();
  myDetailStorage.clear();

  Iterator it = prop.keySet().iterator();
  while  (it.hasNext()){
    String username = (String)it.next();
    uae.setAsText(prop.getProperty(username));
    UserAttribute attrs = (UserAttribute) uae.getValue();
    if (attrs != null) {
      myDetailStorage.put(username, makeUser(username, attrs));
    }
  }
      }
View Full Code Here

            String roles;

            try {
                roles = request.getEntity().getText();

                UserAttributeEditor uae = new UserAttributeEditor();
                uae.setAsText(roles);
                myUserService.setUserDetails(username, (UserAttribute) uae.getValue());
            } catch (Exception e) {
                e.printStackTrace();
                roles = "failure";
            }
View Full Code Here

TOP

Related Classes of org.acegisecurity.userdetails.memory.UserAttributeEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.