@ Override public User createUser ( String username , String password ) throws AuthenticationException { String user = file_store . getProperty ( username ) ; if ( user != null ) { throw new AuthenticationException ( "User '" + username + "' already exists." ) ; } // Encrypt the new password String ePwd = encryptPassword ( password ) ; file_store . put ( username , ePwd ) ; try { saveUsers ( ) ; } catch ( IOException e ) { throw new AuthenticationException ( "Error changing password: " , e ) ; } return getUser ( username ) ; }
Create a user .