{
return null;
}
// then make sure it's a file type we recognize
FileFactoryConfiguration config = null;
String source = "VelocityView.getConfiguration("+path+","+required+")";
if (path.endsWith(".xml"))
{
config = new XmlFactoryConfiguration(this.deprecationSupportMode, source);
}
else if (path.endsWith(".properties"))
{
config = new PropertiesFactoryConfiguration(source);
}
else
{
String msg = "Unknown configuration file type: " + path +
"\nOnly .xml and .properties configuration files are supported at this time.";
getLog().debug(msg);
if (required)
{
throw new UnsupportedOperationException(msg);
}
else
{
return null;
}
}
// now, try to read the file
try
{
config.read(inputStream);
}
catch (IOException ioe)
{
String msg = "Failed to load configuration at: "+path;
getLog().error(msg, ioe);