PageRenderTime 36ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Unknown | 30 lines | 24 code | 6 blank | 0 comment | 0 complexity | ee06c7f8479ebd5f4528483bb10d83a4 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. this.caller.namespace.getClassManager().addClassPath( url );
  24. }