Class FileConfigurationSource

java.lang.Object
com.suse.common.configuration.BaseConfigurationSource
com.suse.common.configuration.FileConfigurationSource
All Implemented Interfaces:
ConfigurationSource

public class FileConfigurationSource extends BaseConfigurationSource
  • Field Details

    • CONFIG_PATH_COMPARATOR

      private static final Comparator<Path> CONFIG_PATH_COMPARATOR
    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • fallbackNamespaces

      private final List<String> fallbackNamespaces
    • commonFilePrefix

      private final String commonFilePrefix
    • configValues

      private final Properties configValues
  • Constructor Details

    • FileConfigurationSource

      public FileConfigurationSource(List<Path> fileSourcesIn)
      Builds a file configuration source.
      Parameters:
      fileSourcesIn - List of files and directories to process
    • FileConfigurationSource

      public FileConfigurationSource(List<Path> fileSourcesIn, String filePrefixIn)
      Builds a file configuration source.
      Parameters:
      fileSourcesIn - List of files and directories to process
      filePrefixIn - a common prefix used by all configuration file names
    • FileConfigurationSource

      public FileConfigurationSource(List<Path> fileSourcesIn, String filePrefixIn, List<String> fallbackNamespacesIn)
      Builds a file configuration source.
      Parameters:
      fileSourcesIn - List of files and directories to process
      filePrefixIn - a common prefix used by all configuration file names
      fallbackNamespacesIn - namespaces to search for, in the given order. These are used when a property, specified with no namespace, was not found.
  • Method Details

    • getRawValue

      protected String getRawValue(String property)
      Get the configuration entry for given property
      Specified by:
      getRawValue in class BaseConfigurationSource
      Parameters:
      property - string to get the value of
      Returns:
      the value
    • getPropertyNames

      public Set<String> getPropertyNames()
      Description copied from interface: ConfigurationSource
      Retrieves the names of all the available properties.
      Returns:
      the set of property names
    • getConfigurationStream

      private static Stream<Path> getConfigurationStream(List<Path> locationsList)
    • loadProperties

      private Properties loadProperties(Path file)
    • makeNamespace

      private String makeNamespace(Path path)