Buju 0.4

biz.bbeans.buju
Class BServerAccess

java.lang.Object
  extended bybiz.bbeans.buju.BServerAccess

public class BServerAccess
extends Object

A utility for maintaining user ID's and passwords.


Constructor Summary
BServerAccess(String propFile)
          Create a new BServerAccess using the given access properties file name.
 
Method Summary
 boolean allowed(String user, String password)
          Check if the given user with the given password is in the access list.
static biz.bbeans.usage.BUsage getUsage()
          Build and return the command line usage for the Main method.
static void main(String[] args)
          For usage display on standard output, use -h option.
 void put(String user, String password)
          Put the user and password in the access list.
 void remove(String user)
          Remove the user from the access list.
 void store()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BServerAccess

public BServerAccess(String propFile)
              throws IOException
Create a new BServerAccess using the given access properties file name.

Parameters:
propFile - List of user ID's and password digests.
Throws:
IOException - If an I/O exception occurs.
Method Detail

put

public void put(String user,
                String password)
         throws NoSuchAlgorithmException,
                UnsupportedEncodingException
Put the user and password in the access list.

Parameters:
user - User ID. Spaces not allowed.
password - Password in clear text.
Throws:
NoSuchAlgorithmException - If the encryption algorithm is not supported.
UnsupportedEncodingException - If UTF-8 character set encoding is not supported.

remove

public void remove(String user)
Remove the user from the access list.

Parameters:
user - User ID. Spaces not allowed.

store

public void store()
           throws IOException
Throws:
IOException

allowed

public boolean allowed(String user,
                       String password)
                throws NoSuchAlgorithmException,
                       UnsupportedEncodingException
Check if the given user with the given password is in the access list.

Parameters:
user - User ID. Spaces not allowed.
password - Password in clear text.
Returns:
Allowed.
Throws:
NoSuchAlgorithmException - If the encryption algorithm is not supported.
UnsupportedEncodingException - If UTF-8 character set encoding is not supported.

getUsage

public static biz.bbeans.usage.BUsage getUsage()
Build and return the command line usage for the Main method. Usage help can then be displayed by calling: printUsage(PrintStream ps) on the returned BUsage object.

Returns:
Command line usage.

main

public static void main(String[] args)
For usage display on standard output, use -h option.


Buju 0.4