com.lyrisoft.chat.server.remote.auth
Class Passwd

java.lang.Object
  |
  +--com.lyrisoft.chat.server.remote.auth.Passwd

public class Passwd
extends java.lang.Object

Represents a unix-style passwd file with three colon-delimited fields:

  • userId (String)
  • access level (int)
  • crypted password (String)


    Constructor Summary
    Passwd()
               
     
    Method Summary
    static PasswdRecord getRecord(java.lang.String userId, java.lang.String password)
              Gets a PasswdRecord.
    static void main(java.lang.String[] args)
               
    static void writeRecord(PasswdRecord r)
              Write a PasswdRecord to the passwd file.
    static void writeRecord(java.lang.String userId, int access, java.lang.String passwd)
              Write a new entry to the passwd file.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    Passwd

    public Passwd()
    Method Detail

    getRecord

    public static final PasswdRecord getRecord(java.lang.String userId,
                                               java.lang.String password)
                                        throws java.io.IOException,
                                               AccessDenied
    Gets a PasswdRecord.
    Parameters:
    userId - the user Id
    password - the password in plaintext
    Returns:
    the PasswdRecord or null if the user was not found

    writeRecord

    public static final void writeRecord(PasswdRecord r)
                                  throws java.io.IOException
    Write a PasswdRecord to the passwd file. If an line already existed for the user specified, it gets overwritten, otherwise, it is appended.
    Parameters:
    r - the record to write

    writeRecord

    public static final void writeRecord(java.lang.String userId,
                                         int access,
                                         java.lang.String passwd)
                                  throws java.io.IOException
    Write a new entry to the passwd file. If an entry already exists for the given userId, it gets overwritten, otherwise, it is appended. The password specified here gets encrypted.
    Parameters:
    userId - the user Id
    access - the access level
    passwd - the plaintext password that will get encrypted

    main

    public static void main(java.lang.String[] args)


    Copyright © 2000-2002 Taso Lyristis