rkuhn comments applied: no more extension

This commit is contained in:
Crossing-Tech 2013-01-04 10:48:38 +01:00
parent 94b145fc95
commit abb8366eb4

View file

@ -44,10 +44,8 @@ class OsgiActorSystemFactory(val context: BundleContext, val fallbackClassLoader
def actorSystemConfig(context: BundleContext): Config = {
val bundleSymbolicName = context.getBundle.getSymbolicName
val bundleId = context.getBundle.getBundleId
val acceptedFileExtension = List("conf", "properties", "json")
val acceptedFileName = List(s"bundle-$bundleSymbolicName", s"bundle-$bundleId", "akka")
val configurationFiles = acceptedFileName.flatMap(x => acceptedFileExtension.map(y => s"etc/$x.$y"))
val applicationConfiguration = configurationFiles.foldLeft(ConfigFactory.empty())((x, y) => x.withFallback(ConfigFactory.parseFileAnySyntax(new File(y))))
val acceptedFilePath = List(s"bundle-$bundleSymbolicName", s"bundle-$bundleId", "akka").map(x => s"etc/$x")
val applicationConfiguration = acceptedFilePath.foldLeft(ConfigFactory.empty())((x, y) => x.withFallback(ConfigFactory.parseFileAnySyntax(new File(y))))
applicationConfiguration.withFallback(ConfigFactory.load(classloader).withFallback(ConfigFactory.defaultReference(OsgiActorSystemFactory.akkaActorClassLoader)))
}