private Resource getResource(
     ServletContext servletContext,
     ConfigurableWebApplicationContext applicationContext,
     String locations) {
   Resource resource = null;
   String[] configFileLocations =
       locations == null
           ? DEFAULT_PROFILE_CONFIG_FILE_LOCATIONS
           : StringUtils.commaDelimitedListToStringArray(locations);
   for (String location : configFileLocations) {
     location = applicationContext.getEnvironment().resolvePlaceholders(location);
     servletContext.log("Testing for YAML resources at: " + location);
     resource = applicationContext.getResource(location);
     if (resource != null && resource.exists()) {
       break;
     }
   }
   return resource;
 }