Class UserManager

java.lang.Object
com.biglybt.ui.console.multiuser.UserManager

public class UserManager extends Object
The usermanager is responsible for reading the users configuration file and loading in all of the possible users. It is also responsible for authenticating a username/password
  • Field Details

  • Constructor Details

    • UserManager

      public UserManager(String fileName)
      Parameters:
      configFile -
  • Method Details

    • authenticate

      public UserProfile authenticate(String username, String password)
      attempts to locate a user with the specified username and then verifies that the specified password is the same as the password associated with that user
      Parameters:
      username -
      password -
      Returns:
    • getUser

      public UserProfile getUser(String username)
      returns the profile for the user with the specified username otherwise null if there is no such user
      Parameters:
      username -
      Returns:
    • addUser

      public void addUser(UserProfile user)
      adds another user to the users list
      Parameters:
      user -
    • getUsers

      public Collection getUsers()
    • load

      public void load() throws FileNotFoundException
      load a new UserManager object from the specified input stream. The input stream should contain an XML document as encoded by the save() method
      Parameters:
      in -
      Throws:
      FileNotFoundException
    • doLoad

      protected void doLoad(InputStream in)
    • save

      public void save() throws FileNotFoundException
      write the UserManager configuration out to the specified output stream. the configuration is stored in XML format as specified by the XMLEncoder class
      Parameters:
      out -
      Throws:
      FileNotFoundException
      See Also:
      • XMLEncoder
    • doSave

      protected void doSave(OutputStream out)
    • getInstance

      public static UserManager getInstance(PluginInterface pi)
    • deleteUser

      public void deleteUser(String userName)
      removes the user with the specified name
      Parameters:
      userName -