Consider using Jakarta Commons Configuration http://jakarta.apache.org/commons/configuration/ which provides a standardized interface, with typed values (integer/double/arrays...), allowing you to provide the configuration using (a mixture of): * Properties files * XML documents * Property list files (.plist) * JNDI * JDBC Datasource * System properties * Applet parameters * Servlet parameters
Using the following file-loading strategies: * If the combination from base path and file name is a full URL that points to an existing file, this URL will be used to load the file. * If the combination from base path and file name is an absolute file name and this file exists, it will be loaded. * If the combination from base path and file name is a relative file path that points to an existing file, this file will be loaded. * If a file with the specified name exists in the user's home directory, this file will be loaded. * Otherwise the file name is interpreted as a resource name, and it is checked whether the data file can be loaded from the classpath.
Check it out!
|