예제 #1
0
 /**
  * Includes a script.
  *
  * @param f The file describing the script file to be included
  * @return result Object of eval if successful, null otherwise
  */
 public Object includeScript(File f) {
   Object result = null;
   try {
     FileReader fr = new FileReader(f);
     try {
       result = ((ScriptEngine) ScriptPlugin.this.sEngine).eval(fr);
     } catch (Throwable t) {
       log(
           Level.SEVERE,
           "Failed to include script " + f.getPath() + " from " + file.getPath(),
           t);
     }
     fr.close();
   } catch (Throwable t) {
     log(Level.SEVERE, "Failed to read file " + f.getPath() + " from " + file.getPath(), t);
   }
   return result;
 }