Class FileConfigurationSource

    • Field Detail

      • CONFIG_PATH_COMPARATOR

        private static final java.util.Comparator<java.nio.file.Path> CONFIG_PATH_COMPARATOR
      • LOGGER

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

        private final java.util.List<java.lang.String> fallbackNamespaces
      • commonFilePrefix

        private final java.lang.String commonFilePrefix
      • configValues

        private final java.util.Properties configValues
    • Constructor Detail

      • FileConfigurationSource

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

        public FileConfigurationSource​(java.util.List<java.nio.file.Path> fileSourcesIn,
                                       java.lang.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​(java.util.List<java.nio.file.Path> fileSourcesIn,
                                       java.lang.String filePrefixIn,
                                       java.util.List<java.lang.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 Detail

      • getRawValue

        protected java.lang.String getRawValue​(java.lang.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 java.util.Set<java.lang.String> getPropertyNames()
        Description copied from interface: ConfigurationSource
        Retrieves the names of all the available properties.
        Returns:
        the set of property names
      • getConfigurationStream

        private static java.util.stream.Stream<java.nio.file.Path> getConfigurationStream​(java.util.List<java.nio.file.Path> locationsList)
      • loadProperties

        private java.util.Properties loadProperties​(java.nio.file.Path file)
      • makeNamespace

        private java.lang.String makeNamespace​(java.nio.file.Path path)