All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datawizards.dqm.configuration.loader.DirectoryConfigurationLoader.scala Maven / Gradle / Ivy

package com.datawizards.dqm.configuration.loader

import java.io.File
import com.datawizards.dqm.configuration.DataQualityMonitoringConfiguration
import com.typesafe.config.{Config, ConfigFactory}

/**
  * Loads configuration from provided path. Each file in directory corresponds to table configuration
  *
  * @param path directory with configuration files
  */
class DirectoryConfigurationLoader(path: String) extends ConfigurationLoader {

  override def loadConfiguration(): DataQualityMonitoringConfiguration = {
    val configuration = readConfiguration()
    DataQualityMonitoringConfiguration(parseTablesConfiguration(configuration))
  }

  protected def readConfiguration(): Seq[Config] = {
    val dir = new File(path)
    dir
      .listFiles()
      .map(f => ConfigFactory.parseFile(f))
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy