PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre3/bsh/commands/load.bsh

#
Unknown | 18 lines | 13 code | 5 blank | 0 comment | 0 complexity | 8ef80952dc97811ec21e634c10c2b32d MD5 | raw file
 1
 2bsh.help.load = "usage: load(filename)";
 3
 4Object load( String filename ) {
 5	file = pathToFile( filename );
 6
 7	Object obj;
 8	FileInputStream in = new FileInputStream( file );
 9	ObjectInputStream oin = new ObjectInputStream(in);
10	obj = oin.readObject();
11	oin.close();
12
13	// bind bsh objects into the caller's namespace
14	if ( obj instanceof bsh.This )
15		bind( obj, this.caller.namespace );
16
17	return obj;
18}