public final class ConfigurationFormats extends Object
ConfigurationFormat
instances.| Modifier and Type | Method and Description |
|---|---|
static org.apache.tamaya.spi.PropertySource |
createPropertySource(String resource,
InputStream inputStream,
Collection<ConfigurationFormat> formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats
in order and transforms it into a
PropertySource using a default mapping. |
static org.apache.tamaya.spi.PropertySource |
createPropertySource(String resource,
InputStream inputStream,
ConfigurationFormat... formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats
in order and transforms it into a
PropertySource using a default mapping. |
static org.apache.tamaya.spi.PropertySource |
createPropertySource(URL url,
Collection<ConfigurationFormat> formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats
in order and transforms it into a
PropertySource using a default mapping. |
static org.apache.tamaya.spi.PropertySource |
createPropertySource(URL url,
ConfigurationFormat... formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats
in order and transforms it into a
PropertySource using a default mapping. |
static List<ConfigurationFormat> |
getFormats()
Get all currently available formats, ordered by priority.
|
static List<ConfigurationFormat> |
getFormats(String... formatNames)
Get all currently available formats, ordered by priority.
|
static List<ConfigurationFormat> |
getFormats(URL url)
Get all currently available formats, ordered by priority.
|
static Collection<ConfigurationData> |
readConfigurationData(Collection<URL> urls,
Collection<ConfigurationFormat> formats) |
static Collection<ConfigurationData> |
readConfigurationData(Collection<URL> urls,
ConfigurationFormat... formats) |
static ConfigurationData |
readConfigurationData(String resource,
InputStream inputStream,
Collection<ConfigurationFormat> formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats in order.
|
static ConfigurationData |
readConfigurationData(String resource,
InputStream inputStream,
ConfigurationFormat... formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats in order.
|
static ConfigurationData |
readConfigurationData(URL url)
Tries to read configuration data from a given URL, hereby traversing all known formats in order of precedence.
|
static ConfigurationData |
readConfigurationData(URL url,
Collection<ConfigurationFormat> formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats in order.
|
static ConfigurationData |
readConfigurationData(URL url,
ConfigurationFormat... formats)
Tries to read configuration data from a given URL, hereby explicitly trying all given formats in order.
|
public static List<ConfigurationFormat> getFormats()
public static List<ConfigurationFormat> getFormats(String... formatNames)
formatNames - available formats to be ordered.public static List<ConfigurationFormat> getFormats(URL url)
url - source to read configuration from.public static ConfigurationData readConfigurationData(URL url) throws IOException
url - the url from where to read, not null.IOException - if the resource cannot be read.public static ConfigurationData readConfigurationData(URL url, ConfigurationFormat... formats) throws IOException
url - the url from where to read, not null.formats - the formats to try.IOException - if the resource cannot be read.public static ConfigurationData readConfigurationData(URL url, Collection<ConfigurationFormat> formats) throws IOException
url - the url from where to read, not null.formats - the formats to try.IOException - if the resource cannot be read.public static Collection<ConfigurationData> readConfigurationData(Collection<URL> urls, ConfigurationFormat... formats)
urls - the urls from where to read, not null.formats - the formats to try.ConfigurationData of the files successfully decoded by the
given formats.public static Collection<ConfigurationData> readConfigurationData(Collection<URL> urls, Collection<ConfigurationFormat> formats)
urls - the urls from where to read, not null.formats - the formats to try.ConfigurationData of the files successfully decoded by the
given formats.public static ConfigurationData readConfigurationData(String resource, InputStream inputStream, ConfigurationFormat... formats) throws IOException
resource - a descriptive name for the resource, since an InputStream does not have anyinputStream - the inputStream from where to read, not null.formats - the formats to try.IOException - if the resource cannot be read.public static ConfigurationData readConfigurationData(String resource, InputStream inputStream, Collection<ConfigurationFormat> formats) throws IOException
resource - a descriptive name for the resource, since an InputStream does not have anyinputStream - the inputStream from where to read, not null.formats - the formats to try.org.apache.tamaya.ConfigException - if the resource cannot be read.IOExceptionpublic static org.apache.tamaya.spi.PropertySource createPropertySource(URL url, ConfigurationFormat... formats) throws IOException
PropertySource using a default mapping.url - the URL to read, not null.formats - the formats to try. If not formats are passed explicitly, all known formats
are tried.org.apache.tamaya.ConfigException - if the resource cannot be read.IOException - if the URL's stream can not be opened.public static org.apache.tamaya.spi.PropertySource createPropertySource(URL url, Collection<ConfigurationFormat> formats) throws IOException
PropertySource using a default mapping.url - the URL to read, not null.formats - the formats to try. If not formats are passed explicitly, all known formats
are tried.org.apache.tamaya.ConfigException - if the resource cannot be read.IOException - if the URL's stream can not be opened.public static org.apache.tamaya.spi.PropertySource createPropertySource(String resource, InputStream inputStream, ConfigurationFormat... formats)
PropertySource using a default mapping.resource - a descriptive name for the resource, since an InputStream does not have anyinputStream - the inputStream from where to read, not null.formats - the formats to try. If not formats are passed explicitly, all known formats
are tried.org.apache.tamaya.ConfigException - if the resource cannot be read.public static org.apache.tamaya.spi.PropertySource createPropertySource(String resource, InputStream inputStream, Collection<ConfigurationFormat> formats)
PropertySource using a default mapping.resource - a descriptive name for the resource, since an InputStream does not have anyinputStream - the inputStream from where to read, not null.formats - the formats to try. If not formats are passed explicitly, all known formats
are tried.org.apache.tamaya.ConfigException - if the resource cannot be read.Copyright © 2016–2017 Apache Software Foundation. All rights reserved.