Hi,
Lets say, have a list of conf files which are needed to load into the
ConfigFactory.load() and all the config files values need to be used in my application.
val value1 = config.getString(“key1”)
For example: There are three config files and from each file key and values needed to as part of the application program.
var fileNameArray: Array[String] = “mysql,hbase,mongodb”.split(",")
fileNameArray = fileNameArray.map(e => e + “.conf”)
for (eachfile <- fileNameArray) {
var curFileIndex = eachfile
println("curFileIndex—> "+ curFileIndex)
var curConfig = ConfigFactory.load(curFileIndex)
config = config.withFallback(curConfig)
}
Please can anyone of you suggest how to get the all key and values loaded into a single config Object by using the ConfigFactory.load() API.