home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Comunicatii / advwebrank / awr.msi / disk1.cab / bsh_1.2b6.jar / bsh / commands / source.bsh < prev    next >
Encoding:
Text File  |  2002-05-26  |  442 b   |  19 lines

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