Package org.craftercms.commons.config
Class ConfigurationResolverImpl
java.lang.Object
org.craftercms.commons.config.ConfigurationResolverImpl
- All Implemented Interfaces:
ConfigurationResolver
Default implementation of
ConfigurationResolver- Since:
- 3.1.6
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe path pattern for the default environmentprotected EncryptionAwareConfigurationReaderstatic final Stringprotected StringThe active environmentprotected StringThe path pattern for a specific environmentstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationResolverImpl(String environment, String basePath, String envPath, EncryptionAwareConfigurationReader configurationReader) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.configuration2.HierarchicalConfiguration<?> getXmlConfiguration(String module, String path, ConfigurationProvider provider) Get the content of a given configuration file
-
Field Details
-
DEFAULT_ENVIRONMENT
- See Also:
-
PLACEHOLDER_MODULE
- See Also:
-
PLACEHOLDER_ENVIRONMENT
- See Also:
-
environment
The active environment -
basePath
The path pattern for the default environment -
envPath
The path pattern for a specific environment -
configurationReader
-
-
Constructor Details
-
ConfigurationResolverImpl
@ConstructorProperties({"environment","basePath","envPath","configurationReader"}) public ConfigurationResolverImpl(String environment, String basePath, String envPath, EncryptionAwareConfigurationReader configurationReader)
-
-
Method Details
-
getXmlConfiguration
public org.apache.commons.configuration2.HierarchicalConfiguration<?> getXmlConfiguration(String module, String path, ConfigurationProvider provider) throws ConfigurationException Description copied from interface:ConfigurationResolverGet the content of a given configuration file- Specified by:
getXmlConfigurationin interfaceConfigurationResolver- Parameters:
module- the name of the modulepath- the path of the fileprovider- the provider to read the file- Returns:
- the configuration instance
- Throws:
ConfigurationException- if there is any error reading the configuration
-