final String encoding) throws ScriptException
{
final ResourceKey resourceKey = createKeyFromString(resourceManager, contextKey, file);
if (resourceKey == null)
{
throw new ScriptException("Unable to load script");
}
try
{
final ResourceData loadedResource = resourceManager.load(resourceKey);
final byte[] resource = loadedResource.getResource(resourceManager);
return eval(new String(resource, encoding), defaultScriptLanguage);
}
catch (ResourceLoadingException e)
{
throw new ScriptException(e);
}
catch (UnsupportedEncodingException e)
{
throw new ScriptException(e);
}
}