| java.lang.Object net.jforum.util.preferences.SystemGlobals
SystemGlobals | public class SystemGlobals implements VariableStore(Code) | | Store global configurations used in the system.
This is an helper class used to access the values
defined at SystemGlobals.properties and related
config files.
Transient values are stored in a special place, and are not
modified when you change a regular key's value.
author: Rafael Steil author: Pieter Olivier version: $Id: SystemGlobals.java,v 1.35 2007/09/02 15:51:04 andowson Exp $ |
fetchConfigKeyIterator | public static Iterator fetchConfigKeyIterator()(Code) | | Retrieve an iterator that iterates over all known configuration keys
An iterator that iterates over all known configuration keys |
getApplicationResourceDir | public static String getApplicationResourceDir()(Code) | | Gets the path to the resource's directory.
This method returns the directory name where the config
files are stored.
Caso queira saber o caminho absoluto do diretorio, voce precisa
usar
Note that this method does not return the complete path. If you
want the full path, you must use
SystemGlobals.getApplicationPath() + SystemGlobals.getApplicationResourcedir()
String with the name of the resource dir, relative to application's root dir. See Also: SystemGlobals.getApplicationPath() |
getBoolValue | public static boolean getBoolValue(String field)(Code) | | Retrieve an boolean-values configuration field
Parameters: field - name of the configuration option The value of the configuration option exception: NullPointerException - when the field does not exists |
getIntValue | public static int getIntValue(String field)(Code) | | Retrieve an integer-valued configuration field
Parameters: field - Name of the configuration option The value of the configuration option exception: NullPointerException - when the field does not exists |
getVariableValue | public String getVariableValue(String field)(Code) | | Return the value of a configuration value as a variable. Variable expansion is performe
on the result.
Parameters: field - The field name to retrieve The value of the field if present or null if not |
initGlobals | public static void initGlobals(String appPath, String mainConfigurationFile)(Code) | | Initialize the global configuration
Parameters: appPath - The application path (normally the path to the webapp base dir Parameters: mainConfigurationFile - The file containing system defaults (when null, defaults to /WEB-INF/config/default.conf) |
loadAdditionalDefaults | public static void loadAdditionalDefaults(String file)(Code) | | Merge additional configuration defaults
Parameters: file - File from which to load the additional defaults |
loadDefaults | public static void loadDefaults()(Code) | | Load system defaults
|
loadQueries | public static void loadQueries(String queryFile)(Code) | | Load the SQL queries
Parameters: queryFile - Complete path to the SQL queries file. |
reset | public static void reset()(Code) | | |
saveInstallation | public static void saveInstallation()(Code) | | Save installation defaults
|
setApplicationPath | public static void setApplicationPath(String ap)(Code) | | Sets the application's root directory
Parameters: ap - String containing the complete path to the root dir See Also: SystemGlobals.getApplicationPath |
setTransientValue | public static void setTransientValue(String field, String value)(Code) | | Set a transient configuration value (a value that will not be saved)
Parameters: field - The name of the configuration option Parameters: value - The value of the configuration option |
|
|