Import scripted or compiled BeanShell commands in the following package in the classpath. You may use either "/" path or "." package notation. e.g. importCommands("/bsh/commands") or importCommands("bsh.commands") are equivalent. If a relative path style specifier is used then it is made i
( String name )
| 828 | made into an absolute path by prepending "/". |
| 829 | */ |
| 830 | public void importCommands( String name ) |
| 831 | { |
| 832 | if ( importedCommands == null ) |
| 833 | importedCommands = new ArrayList<String>(); |
| 834 | |
| 835 | // dots to slashes |
| 836 | name = name.replace('.','/'); |
| 837 | // absolute |
| 838 | if ( !name.startsWith("/") ) |
| 839 | name = "/"+name; |
| 840 | // remove trailing (but preserve case of simple "/") |
| 841 | if ( name.length() > 1 && name.endsWith("/") ) |
| 842 | name = name.substring( 0, name.length()-1 ); |
| 843 | |
| 844 | // If it exists, remove it and add it at the end (avoid memory leak) |
| 845 | importedCommands.remove( name ); |
| 846 | |
| 847 | importedCommands.add(name); |
| 848 | nameSpaceChanged(); |
| 849 | } |
| 850 | |
| 851 | /** |
| 852 | A command is a scripted method or compiled command class implementing a |
no test coverage detected