Package io.smallrye.config.source.file
Class FileSystemConfigSource
- java.lang.Object
-
- io.smallrye.config.common.AbstractConfigSource
-
- io.smallrye.config.common.MapBackedConfigSource
-
- io.smallrye.config.source.file.FileSystemConfigSource
-
- All Implemented Interfaces:
Serializable,org.eclipse.microprofile.config.spi.ConfigSource
public class FileSystemConfigSource extends MapBackedConfigSource
Read configuration from a file directory.Each file in the directory corresponds to a property where the file name is the property key and the file textual content is the property value.
For example, if a directory structure looks like:
foo/ ├── num.max └── num.sizenew FileSystemConfigSource(new File("foo"), 100)will provide 2 properties:num.maxnum.size
Nested directories are not supported.
- Author:
- Jeff Mesnil (c) 2017 Red Hat inc.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FileSystemConfigSource(File dir)FileSystemConfigSource(File dir, int ordinal)Construct a new instanceFileSystemConfigSource(String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetValue(String name)-
Methods inherited from class io.smallrye.config.common.MapBackedConfigSource
getProperties, getPropertyNames
-
Methods inherited from class io.smallrye.config.common.AbstractConfigSource
getName, getOrdinal, toString
-
-
-
-
Constructor Detail
-
FileSystemConfigSource
public FileSystemConfigSource(File dir)
-
FileSystemConfigSource
public FileSystemConfigSource(String dir)
-
FileSystemConfigSource
public FileSystemConfigSource(File dir, int ordinal)
Construct a new instance- Parameters:
dir- the directory, containing configuration filesordinal- the ordinal value
-
-
Method Detail
-
getValue
public String getValue(String name)
- Specified by:
getValuein interfaceorg.eclipse.microprofile.config.spi.ConfigSource- Overrides:
getValuein classMapBackedConfigSource
-
-