Package com.chillycheesy.modulo.config
Class PropertiesConfigurationStrategy
java.lang.Object
com.chillycheesy.modulo.config.PropertiesConfigurationStrategy
- All Implemented Interfaces:
ConfigurationLoaderStrategy
Loads and saves a configuration from a properties file.
NOTE: This strategy don't support the configuration properties inside a List
NOTE: This strategy don't support the configuration properties inside a List
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadConfiguration(InputStream inputStream)Loads a configuration from an input stream.voidsaveConfiguration(Configuration configuration, OutputStream outputStream)Saves a configuration to an output stream.
-
Constructor Details
-
PropertiesConfigurationStrategy
public PropertiesConfigurationStrategy()
-
-
Method Details
-
loadConfiguration
Loads a configuration from an input stream.- Specified by:
loadConfigurationin interfaceConfigurationLoaderStrategy- Parameters:
inputStream- The input stream to load from.- Returns:
- The loaded configuration.
- Throws:
IOException- If an error occurs while loading the configuration.
-
saveConfiguration
public void saveConfiguration(Configuration configuration, OutputStream outputStream) throws IOExceptionSaves a configuration to an output stream.- Specified by:
saveConfigurationin interfaceConfigurationLoaderStrategy- Parameters:
configuration- The configuration to save.outputStream- The output stream to save to.- Throws:
IOException- If an error occurs while saving the configuration.
-