Class ConfigLoader


  • public final class ConfigLoader
    extends Object
    Internal helper class responsible for loading configuration files. This class handles the detection and loading of various configuration file formats.

    This is an internal class and should not be used directly by clients. Use ConfNG instead.

    Since:
    1.0
    Author:
    Bharat Kumar Malviya
    • Method Detail

      • load

        public static void load​(String filePath,
                                Consumer<ConfigSource> sourceRegistrar)
        Loads a configuration file by auto-detecting its type based on the file extension.
        Parameters:
        filePath - path to the configuration file
        sourceRegistrar - callback to register the loaded source
      • load

        public static void load​(String filePath,
                                String environment,
                                Consumer<ConfigSource> sourceRegistrar)
        Loads a configuration file with environment-specific section.
        Parameters:
        filePath - path to the configuration file
        environment - the environment section to load
        sourceRegistrar - callback to register the loaded source
      • loadProperties

        public static void loadProperties​(String filePath,
                                          Consumer<ConfigSource> sourceRegistrar)
        Loads a properties file.