Class sun.server.util.PasswordFile
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.util.PasswordFile

java.lang.Object
   |
   +----sun.server.util.PasswordFile

public class PasswordFile
extends Object
A class that reads and writes into the password file. This doesn't (currently) perform any locking between processes; concurrent updates could be lost.

Constructor Index

 o PasswordFile(String)
This class builds a hashtable out of a password file.

Method Index

 o getPasswd(String)
The method returns the password for the user.
 o read()
This method reads the password file into the hash table.
 o setPasswd(String, String)
Stores the password in both in-memory and on-disk versions of the password file.
 o users()
 o writePassword(String, String)
The method appends a new entry to the password file.

Constructors

 o PasswordFile
  public PasswordFile(String keyFile)
This class builds a hashtable out of a password file. The password file is created by the admin console.

Methods

 o read
  public void read() throws IOException
This method reads the password file into the hash table. It stores the the decoded password in the table.
 o getPasswd
  public synchronized String getPasswd(String user)
The method returns the password for the user.
Parameters:
user - the user for which password is required.
Returns:
the decoded (plain text) password.
 o setPasswd
  public synchronized void setPasswd(String user,
                                     String password) throws NullPointerException, IOException
Stores the password in both in-memory and on-disk versions of the password file.
Parameters:
user - the username
password - the plaintext password - if null delete the user
 o writePassword
  public synchronized void writePassword(String user,
                                         String password) throws IOException, PasswdEntryException
The method appends a new entry to the password file.
Parameters:
user - the user name
password - the password in plain text.
Throws: IOException
if the file could not be appended
Throws: PasswdEntryException
if the user had an existing entry
 o users
  public synchronized Enumeration users()

All Packages  Class Hierarchy  This Package  Previous  Next  Index