PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. @method void addClassPath( string | URL )
  13. */
  14. bsh.help.addClassPath= "usage: addClassPath( string | URL )";
  15. import java.net.URL;
  16. import bsh.BshClassManager;
  17. addClassPath( path ) {
  18. URL url;
  19. if ( path instanceof URL )
  20. url = path;
  21. else
  22. url = pathToFile( path ).toURL();
  23. BshClassManager.getClassManager().addClassPath( url );
  24. }