private void readPropertySourceFromLoader(String fileName, String filePath, PropertySourceLoader propertySourceLoader, List<PropertySource> propertySources) throws ConfigurationException {
        ResourceResolver resourceResolver = new ResourceResolver();
        Optional<ResourceLoader> resourceLoader = resourceResolver.getSupportingLoader(filePath);
        ResourceLoader loader = resourceLoader.orElse(FileSystemResourceLoader.defaultLoader());
        try {
            Optional<InputStream> inputStream = loader.getResourceAsStream(filePath);
            if (inputStream.isPresent()) {
                Map<String, Object> properties = propertySourceLoader.read(fileName, inputStream.get());
                propertySources.add(PropertySource.of(properties));
            }
        } catch (IOException e) {
            throw new ConfigurationException("Unsupported properties file: " + fileName);
        }
    }
private void readPropertySourceFromLoader ( String fileName , String filePath , PropertySourceLoader propertySourceLoader , List < PropertySource > propertySources ) throws ConfigurationException { ResourceResolver resourceResolver = new ResourceResolver ( ) ; Optional < ResourceLoader > resourceLoader = resourceResolver . getSupportingLoader ( filePath ) ; ResourceLoader loader = resourceLoader . orElse ( FileSystemResourceLoader . defaultLoader ( ) ) ; try { Optional < InputStream > inputStream = loader . getResourceAsStream ( filePath ) ; if ( inputStream . isPresent ( ) ) { Map < String , Object > properties = propertySourceLoader . read ( fileName , inputStream . get ( ) ) ; propertySources . add ( PropertySource . of ( properties ) ) ; } } catch ( IOException e ) { throw new ConfigurationException ( "Unsupported properties file: " + fileName ) ; } }
Read the property source.

@param fileName             Name of the file to be used as property source name
@param filePath             Absolute file path
@param propertySourceLoader The appropriate property source loader
@param propertySources      List of property sources to add to
@throws ConfigurationException If unable to find the appropriate property soruce loader for the given file