PageRenderTime 28ms CodeModel.GetById 25ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/bsh/commands/addClassPath.bsh

#
Unknown | 30 lines | 24 code | 6 blank | 0 comment | 0 complexity | d938a90a00c69f6fa32a36ca2c13cc98 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	BshClassManager.getClassManager().addClassPath( url );
29}
30