{
// If we don't get a properly formed resourceName
// then there's not much we can do. So
// we'll forget about trying to search
// any more paths for the template.
throw new NestableException(
"Need to specify a file name or file path!");
}
try
{
File file = new File(resourceName);
if (file.canRead())
{
return new BufferedInputStream(
new FileInputStream(file.getAbsolutePath()));
}
else
{
throw new NestableException(
"File resource " + resourceName + " is not readable!");
}
}
catch( FileNotFoundException fnfe )
{
throw new NestableException(
"File resource " + resourceName + " cannot be found!");
}
}