The config file

    The config file was made to improve the security level. However it can contain also some configuration details as for example the settings of the database. Mainly it consists of the FILE and the SECURITY tag.

    We may not want to allow the user to read from all the files in our filesystem. Therefor we are going to create a config file which includes a list of files and a security flag with one can turn the security on and off. This file is to be read right on the beginning and every time a file is added. There should be a possibility to reload this file.

    The *FILE in the config file includes all names and nicknames of the files which are readable by the user. They are written like the following:

    name::filename
    or
    filename
    or
    default::filename

    The names left of the two colons are the nicknames and the key for a hashtable at the same time. If the nickname is "default", this file will be loaded as standard file. If no default is defined, nothing will be done.

    The *SECURITY includes all tags which do not have to be secure. For instance if we want to allow the user to see all of the files, without any restrictions, we set the flag to "off":

    FILE::off

    We are able to extend the security later.

    We have a hashtable for the list of the files and one for the list of the security flags. These are stored in a hashtable again.

    If the flag in the *SECURITY is on, then it gets every line of the *FILE part and takes it into key and value and put it in the hashtable.

    The *DB may be used to set the details for the database. Please use following keys:

    JDBCDRIVER::your_jdbc_driver
    URL::your_URL
    UID::your_UID
    PWD::your_Password

    It is possible to reload the config file without disconnecting the servlet. Just provide a tag RELOAD=yes and the servlet will automatically get the new config file. (Please do not use RELOAD=no, it is not necessary.)

Back