public class IniConfigurationFormat extends Object implements ConfigurationFormat
| Constructor and Description |
|---|
IniConfigurationFormat() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(URL url)
Allows the format to examine the given resource, e.g. for a matching file ending.
|
String |
getName()
Get a unique name of the format.
|
ConfigurationData |
readConfiguration(String resource,
InputStream inputStream)
Reads a configuration from an URL, hereby parsing the given
InputStream. |
public String getName()
ConfigurationFormatgetName in interface ConfigurationFormatpublic boolean accepts(URL url)
ConfigurationFormataccepts in interface ConfigurationFormaturl - the url to read the configuration data from (could be a file, a server location, a classpath
resource or something else, not null.public ConfigurationData readConfiguration(String resource, InputStream inputStream) throws IOException
ConfigurationFormatInputStream. Dependening on
the capabilities of the format the returned ConfigurationData may contain
different levels of data:
ConfigurationData.getCombinedProperties(). This allows to use the properties as inout to a default mapping,
which is always appropriate as long as no other semnatics
are defined in the concrete target scenario.PropertySource
instances with different ordinal levels. As an example imagine a custom format that contains sections
'defaults', 'global-defaults', 'application', 'server-overrides'.PropertySource.readConfiguration in interface ConfigurationFormatresource - the resource id, not null.inputStream - the inputStream to read from, not null.ConfigurationData containing sections/properties read, never null.IOExceptionPropertySourceCopyright © 2016–2017 Apache Software Foundation. All rights reserved.