blob: 29cd9ed9f5365b82acfce21cd9db9c7ecfd2896a (
plain) (
tree)
|
|
package com.drivergrp.core
import java.io.File
import com.typesafe.config.{Config, ConfigFactory}
object config {
def loadDefaultConfig: Config = {
val configDefaults = ConfigFactory.load(this.getClass.getClassLoader, "application.conf")
scala.sys.props.get("application.config") match {
case Some(filename) =>
val configFile = new File(filename)
if (configFile.exists()) {
ConfigFactory.parseFile(configFile).withFallback(configDefaults)
} else {
throw new IllegalStateException(s"No config found at $filename")
}
case None => configDefaults
}
}
}
|