Skip to end of metadata
Go to start of metadata

LAMS has a system wide configuration file (XML format) containing such information as repository location, server path, maximum file upload size etc. This configuration file should be used by the LAMS core packages and LAMS tools to obtain system wide properties.

The Configuration utility class contains methods to retrieve the values of the keys from the configuration file.
The ConfigurationKeys utility class contains the list of keys available in the configuration file.

How to access configuration items

If you want to retrieve a value from the configuration as a String, use the get() method. For example, if you want to obtain the ServerURL item from the configuration file, you can use this:

String serverURL = Configuration.get(ConfigurationKeys.SERVER_URL);

If you want to retrieve a value from the configuration file as an integer, use the getAsInt() method. For example, if you want to retrieve the maximum file upload size from the config file:

int maxFileSize = Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_MAX_SIZE);

If you want to retrieve a value from the configuration file as a boolean, use the getAsBoolean() method. For example, if you want to determine whether the AllowMultipleLogin is set to true or false:

boolean allowMultipleLogins = Configuration.getAsBoolean(ConfigurationKeys.ALLOW_MULTIPLE_LOGIN);
  • No labels