/jEdit/tags/jedit-4-1-pre4/bsh/commands/source.bsh

# · Unknown · 18 lines · 14 code · 4 blank · 0 comment · 0 complexity · b085bed985038e81023c6f4e3a8dba62 MD5 · raw file

  1. /**
  2. Read filename into the interpreter and evaluate it in the current
  3. namespace. Like the Bourne Shell "." command.
  4. */
  5. bsh.help.source = "usage: source( filename | URL )";
  6. Object source( String filename ) {
  7. return this.interpreter.source( filename, this.caller.namespace );
  8. }
  9. Object source( URL url ) {
  10. return this.interpreter.eval(
  11. new InputStreamReader(url.openStream()), this.caller.namespace,
  12. "URL: "+url.toString()
  13. );
  14. }