PageRenderTime 129ms CodeModel.GetById 126ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 1ms

/jEdit/tags/jedit-4-2-pre4/bsh/commands/addClassPath.bsh

#
Unknown | 30 lines | 24 code | 6 blank | 0 comment | 0 complexity | ee06c7f8479ebd5f4528483bb10d83a4 MD5 | raw file
 1/**
 2	Add the specified directory or JAR file to the class path.
 3	e.g.
 4	<p>
 5	<pre>
 6    addClassPath( "/home/pat/java/classes" );
 7    addClassPath( "/home/pat/java/mystuff.jar" );
 8    addClassPath( new URL("http://myserver/~pat/somebeans.jar") );
 9	</pre>
10	<p>
11	See <a href="classpath.html">Class Path Management</a>
12
13	@method void addClassPath( string | URL )
14*/
15
16bsh.help.addClassPath= "usage: addClassPath( string | URL )";
17
18import java.net.URL;
19import bsh.BshClassManager;
20
21addClassPath( path ) {
22	URL url;
23	if ( path instanceof URL )
24		url = path;
25	else
26		url = pathToFile( path ).toURL();
27
28	this.caller.namespace.getClassManager().addClassPath( url );
29}
30