return;
}
// Tell the class loader the root of the context
ScriptContext scriptContext = ((Context) container).getScriptContext();
// Assigning permissions for the work directory
File workDir = (File) scriptContext.getAttribute(Globals.ATTR_WORK_DIR);
if (workDir != null)
{
try
{
String workDirPath = workDir.getCanonicalPath();
classLoader.addPermission(new FilePermission(workDirPath, "read,write"));
classLoader.addPermission(
new FilePermission(workDirPath + File.separator + "-", "read,write,delete"));
}
catch (IOException e)
{
// Ignore
}
}
try
{
URL rootURL = scriptContext.getResource("/");
classLoader.addPermission(rootURL);
String contextRoot = scriptContext.getRealPath("/");
try
{
contextRoot = (new File(contextRoot)).getCanonicalPath();
classLoader.addPermission(contextRoot);
}
catch (IOException e)
{
// Ignore
}
URL classesURL = scriptContext.getResource("/WEB-INF/classes/");
classLoader.addPermission(classesURL);
URL libURL = scriptContext.getResource("/WEB-INF/lib/");
classLoader.addPermission(libURL);
if (libURL != null)
{
File rootDir = new File(contextRoot);