Package space.arim.dazzleconf.helper
Class ConfigurationHelper<C>
java.lang.Object
space.arim.dazzleconf.helper.ConfigurationHelper<C>
- Type Parameters:
C- the type of the configuration
Simple helper class designed to assist in reloading a configuration
- Author:
- A248
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurationHelper(Path configFolder, String fileName, ConfigurationFactory<C> factory) Creates from an enclosing directory, filename within that directory, andConfigurationFactory. -
Method Summary
Modifier and TypeMethodDescriptionGets the configuration factoryLoads/reloads the configuration data.
-
Constructor Details
-
ConfigurationHelper
Creates from an enclosing directory, filename within that directory, andConfigurationFactory.
The configuration path will be located atconfigFolder.resolve(fileName)- Parameters:
configFolder- the enclosing directoryfileName- the filename within the directoryfactory- the configuration factory
-
-
Method Details
-
getFactory
Gets the configuration factory- Returns:
- the configuration factory
-
reloadConfigData
Loads/reloads the configuration data. If necessary, updates the config on the filesystem with the latest keys- Returns:
- the loaded config data
- Throws:
IOException- if an I/O exception occurredInvalidConfigException- if the loaded configuration was not valid (user error)
-