Class FileSource<T>

  • All Implemented Interfaces:
    Source<T>

    public class FileSource<T>
    extends AbstractSource<T>
    implements Source<T>
    A specialized configuration source implementation for loading a local file from the file system.

    The path may contain system environment variables, which must be placed between "${" and "}". For example: "${TEMP}/file.txt"

    Since:
    0.1.0
    Author:
    oswaldo.bapvic.jr (Oswaldo Junior)
    • Constructor Detail

      • FileSource

        public FileSource​(String path)
        Builds a new configuration source for specific local file from the file system.
        Parameters:
        path - the file path for this configuration source.
    • Method Detail

      • load

        public T load​(Mapper<T> mapper)
        Description copied from interface: Source
        Applies a specific configuration loading strategy and returns a mapped bean containing the retrieved data, throwing an exception if the operation fails.
        Specified by:
        load in interface Source<T>
        Parameters:
        mapper - the Mapper to be applied on the source input stream
        Returns:
        the loaded configuration data