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.
-
PasswordFile(String)
- This class builds a hashtable out of a password file.
-
getPasswd(String)
- The method returns the password for the user.
-
read()
- This method reads the password file into the hash table.
-
setPasswd(String, String)
- Stores the password in both in-memory and on-disk versions
of the password file.
-
users()
-
-
writePassword(String, String)
- The method appends a new entry to the password file.
PasswordFile
public PasswordFile(String keyFile)
- This class builds a hashtable out of a password file.
The password file is created by the admin console.
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.
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.
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
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
users
public synchronized Enumeration users()
All Packages Class Hierarchy This Package Previous Next Index