public static List<String> loadFactoryNames(Class<?> factoryClass, ClassLoader classLoader) {
   String factoryClassName = factoryClass.getName();
   try {
     List<String> result = new ArrayList<String>();
     Enumeration<URL> urls = classLoader.getResources(FACTORIES_RESOURCE_LOCATION);
     while (urls.hasMoreElements()) {
       URL url = urls.nextElement();
       Properties properties = PropertiesLoaderUtils.loadProperties(new UrlResource(url));
       String factoryClassNames = properties.getProperty(factoryClassName);
       result.addAll(
           Arrays.asList(StringUtils.commaDelimitedListToStringArray(factoryClassNames)));
     }
     return result;
   } catch (IOException ex) {
     throw new IllegalArgumentException(
         "Unable to load ["
             + factoryClass.getName()
             + "] factories from location ["
             + FACTORIES_RESOURCE_LOCATION
             + "]",
         ex);
   }
 }
 /**
  * Create a PropertySource based on Properties loaded from the given resource. The name of the
  * PropertySource will be generated based on the {@link Resource#getDescription() description} of
  * the given resource.
  */
 public ResourcePropertySource(Resource resource) throws IOException {
   super(
       getNameForResource(resource),
       PropertiesLoaderUtils.loadProperties(new EncodedResource(resource)));
   this.resourceName = null;
 }
 /**
  * Create a PropertySource having the given name based on Properties loaded from the given encoded
  * resource.
  */
 public ResourcePropertySource(String name, Resource resource) throws IOException {
   super(name, PropertiesLoaderUtils.loadProperties(new EncodedResource(resource)));
   this.resourceName = getNameForResource(resource);
 }