Package org.actioncontroller.config
Class ConfigDirectoryLoader
- java.lang.Object
-
- org.actioncontroller.config.ConfigDirectoryLoader
-
public class ConfigDirectoryLoader extends Object
Given aconfigDirectory, applicationName and profiles, monitors the files<applicationName>.propertiesand<applicationName>-<profile>.propertiesfor each profile in theconfigDirectory. May be expanded to also load classpath resources<applicationName>.propertiesand<applicationName>-<profile>.propertiesin the future.
-
-
Constructor Summary
Constructors Constructor Description ConfigDirectoryLoader(Path configDirectory, String applicationName, List<String> profiles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdescribe()protected List<Path>getConfigurationFiles()protected Predicate<Path>getConfigurationFilesPattern()protected voidloadConfigFile(Properties properties, Path file)Map<String,String>loadConfiguration()voidwatch(FileSystemWatcher fileSystemWatcher, Consumer<Map<String,String>> configChangeListener)
-
-
-
Method Detail
-
loadConfigFile
protected void loadConfigFile(Properties properties, Path file)
-
describe
public String describe()
-
watch
public void watch(FileSystemWatcher fileSystemWatcher, Consumer<Map<String,String>> configChangeListener)
-
-