protected List < PropertySource > readPropertySourceListFromFiles ( String files ) { List < PropertySource > propertySources = new ArrayList <> ( ) ; Collection < PropertySourceLoader > propertySourceLoaders = getPropertySourceLoaders ( ) ; Optional < Collection < String > > filePathList = Optional . ofNullable ( files ) . filter ( value -> ! value . isEmpty ( ) ) . map ( value -> value . split ( FILE_SEPARATOR ) ) . map ( Arrays :: asList ) . map ( Collections :: unmodifiableList ) ; filePathList . ifPresent ( list -> { if ( ! list . isEmpty ( ) ) { list . forEach ( filePath -> { if ( ! propertySourceLoaders . isEmpty ( ) ) { String extension = NameUtils . extension ( filePath ) ; String fileName = NameUtils . filename ( filePath ) ; Optional < PropertySourceLoader > propertySourceLoader = Optional . ofNullable ( loaderByFormatMap . get ( extension ) ) ; if ( propertySourceLoader . isPresent ( ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Reading property sources from loader: {}" , propertySourceLoader ) ; } readPropertySourceFromLoader ( fileName , filePath , propertySourceLoader . get ( ) , propertySources ) ; } else { throw new ConfigurationException ( "Unsupported properties file format: " + fileName ) ; } } } ) ; } } ) ; return propertySources ; }
Resolve the property sources for files passed via system property and system env .