Package com.bobocode.bring.core.env.impl
Class BringPropertySourceLoader
java.lang.Object
com.bobocode.bring.core.env.impl.BringPropertySourceLoader
- All Implemented Interfaces:
BringSourceLoader
Implementation of BringSourceLoader for loading properties from files.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the file extension handled by this loader.getValue
(Properties properties) Loads properties from the default file ("application.properties") and optionally from another specified file, merging them where the latter overrides the former.loadProperties
(String fileName) Loads properties from a specified file.
-
Field Details
-
APPLICATION_PROPERTIES
- See Also:
-
RANDOM_PORT_KEY
- See Also:
-
START_PORT_RANGE
public static final int START_PORT_RANGE- See Also:
-
END_PORT_RANGE
public static final int END_PORT_RANGE- See Also:
-
-
Constructor Details
-
BringPropertySourceLoader
public BringPropertySourceLoader()
-
-
Method Details
-
getFileExtensions
Returns the file extension handled by this loader.- Specified by:
getFileExtensions
in interfaceBringSourceLoader
- Returns:
- The file extension, which is "properties".
-
load
Loads properties from the default file ("application.properties") and optionally from another specified file, merging them where the latter overrides the former.- Specified by:
load
in interfaceBringSourceLoader
- Parameters:
name
- The name of the file containing additional properties. If null, defaults to "application.properties".- Returns:
- A map containing the merged properties from both sources.
-
loadProperties
Loads properties from a specified file.- Parameters:
fileName
- The name of the file to load properties from. If null, defaults to "application.properties".- Returns:
- A map containing the properties loaded from the specified file.
-
getValue
-