/** * {@link EnvironmentPostProcessor} that configures the context environment by loading * properties from well known file locations. By default properties will be loaded from * 'application.properties' and/or 'application.yml' files in the following locations: * <ul> * <li>file:./config/</li> * <li>file:./config/{@literal *}/</li> * <li>file:./</li> * <li>classpath:config/</li> * <li>classpath:</li> * </ul> * The list is ordered by precedence (properties defined in locations higher in the list * override those defined in lower locations). * <p> * Alternative search locations and names can be specified using * {@link #setSearchLocations(String)} and {@link #setSearchNames(String)}. * <p> * Additional files will also be loaded based on active profiles. For example if a 'web' * profile is active 'application-web.properties' and 'application-web.yml' will be * considered. * <p> * The 'spring.config.name' property can be used to specify an alternative name to load * and the 'spring.config.location' property can be used to specify alternative search * locations or specific files. */ publicclassConfigFileApplicationListenerimplementsEnvironmentPostProcessor, SmartApplicationListener, Ordered { @Override publicbooleansupportsEventType(Class<? extends ApplicationEvent> eventType) { return ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(eventType) || ApplicationPreparedEvent.class.isAssignableFrom(eventType); }