in velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java [272:310]
public static FactoryConfiguration findInClasspath(String path, Object caller)
{
// find all resources at this path
List<URL> found = ClassUtils.getResources(path, caller);
if (found.isEmpty())
{
return null;
}
else if (found.size() == 1)
{
// load and return the one config at that URL (if any)
return read(found.get(0));
}
else
{
// create a base config to combine the others into
FactoryConfiguration config =
new FactoryConfiguration("ConfigurationUtils.findInClassPath("+path+","+caller+")");
boolean readAConfig = false;
for (URL resource : found)
{
FactoryConfiguration c = read(resource);
if (c != null)
{
readAConfig = true;
config.addConfiguration(c);
}
}
// only return a configuration if we really found one
if (readAConfig)
{
return config;
}
else
{
return null;
}
}
}