public class BaSyxConfiguration extends Object
| Constructor and Description |
|---|
BaSyxConfiguration(Map<String,String> defaultValues)
Constructor that takes the configuration's default values.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getProperties(String prefix)
Returns all contained properties that begin with a specific prefix
|
String |
getProperty(String name)
Queries a property
|
static InputStream |
getResourceStream(String relativeResourcePath) |
static String |
getResourceString(String relativeResourcePath) |
void |
loadFileOrDefaultResource(String fileKey,
String defaultResource)
Load the configuration from a path relative to the current folder
|
void |
loadFromFile(String filePath)
Load the configuration from a path relative to the current folder
|
void |
loadFromProperties(Properties properties)
Load the configuration directly from properties.
|
void |
loadFromResource(String relativeResourcePath)
Load the configuration from a path relative to the current resource folder
|
void |
loadFromStream(InputStream input)
Load the configuration from an input stream
|
void |
setProperty(String name,
String value)
Sets a property, if it is contained in this configuration
|
public static InputStream getResourceStream(String relativeResourcePath)
public static String getResourceString(String relativeResourcePath) throws IOException
IOExceptionpublic void loadFromFile(String filePath)
filePath - Path to the resource in the application folderpublic void loadFileOrDefaultResource(String fileKey, String defaultResource)
filePath - Path to the resource in the application folderpublic void loadFromStream(InputStream input)
input - the input stream containing the propertiespublic void loadFromResource(String relativeResourcePath)
relativeResourcePath - Path to the resource in the resource folder. In a maven project, the resources
are located at /src/main/resources by default.public void loadFromProperties(Properties properties)
public void setProperty(String name, String value)
name - The name of the propertyvalue - The new value of the propertypublic List<String> getProperties(String prefix)
prefix - The filtered prefix (e.g. "aas.")Copyright © 2021. All rights reserved.