code: protected ScriptEngine getScriptEngine(File file)
      {
          final String extension = getExtension(file.getName());
          if (extension == null)
          {
              return null;
          }
  
          return getScriptEngineManager().getEngineByExtension(extension);
      }
docs: Searches for a ScriptEngine that can handle the given file.
  
  @param file the file to search a ScriptEngine for.
  @return the ScriptEngine or <code>null</code> if none is found.