if (process == null) {
synchronized(this) {
process = processes.get(name);
if (process == null) {
try {
ScriptManager scriptMgr = scriptMgr();
// see if the process is a root level one
String localName = name.getLocalPart();
String namespace = name.getNamespaceURI();
File f = new File(scriptMgr.getWpsRoot(), localName + "." + namespace);
if (!f.exists()) {
// see if it's nested in a directory then
File directory = new File(scriptMgr.getWpsRoot(),
namespace);
if (!directory.exists()) {
throw new FileNotFoundException("Could not find script file "
+ f.getName() + " nor a directory of scripts named "
+ directory.getName());