Typesafe config: Load additional config from path external to packaged scala application

RAbraham picture RAbraham · Aug 12, 2013 · Viewed 30.7k times · Source

My scala application will be packaged into a jar. When I run my app, it needs to read an additional config file stored externally to my app jar. I am looking for functionality similar to the Typesafe Config library but other solutions are welcome too ! Is there a way to do something like below:

val hdfsConfig = ConfigFactory.load("my_path/hdfs.conf")

Answer

cmbaxter picture cmbaxter · Aug 12, 2013

I think what you want is:

val myCfg =  ConfigFactory.parseFile(new File("my_path/hdfs.conf"))