uis = UIConst.UIS.values().iterator();
while (uis.hasNext())
((IUserInterface) uis.next()).startUI();
Class clConsoleInput;
Constructor conConsoleInput =null;
try {
clConsoleInput = Class.forName("org.gudy.azureus2.ui.console.ConsoleInput");
// change this and you'll need to change the parameters below....
Class params[] = {String.class, AzureusCore.class, Reader.class, PrintStream.class, Boolean.class};
conConsoleInput=clConsoleInput.getConstructor(params);
} catch (Exception e) {
e.printStackTrace();
}
if (commands.hasOption('e')) {
if (conConsoleInput != null) {
try {
Object params[] = {commands.getOptionValue('e'), new_core, new FileReader(commands.getOptionValue('e')), System.out, Boolean.FALSE};
conConsoleInput.newInstance(params);
} catch (java.io.FileNotFoundException e) {
Logger.getLogger("azureus2").error("Script file not found: "+e.toString());
} catch (Exception e) {
Logger.getLogger("azureus2").error("Error invocating the script processor: "+e.toString());
}
} else
Logger.getLogger("azureus2").error("ConsoleInput class not found. You need the console ui package to use '-e'");
}
if (commands.hasOption('c')) {
if (conConsoleInput != null) {
String comm = commands.getOptionValue('c');
comm+="\nlogout\n";
Object params[] = {commands.getOptionValue('c'), UIConst.getAzureusCore(), new StringReader(comm), System.out, Boolean.FALSE};
try {
conConsoleInput.newInstance(params);
} catch (Exception e) {
Logger.getLogger("azureus2").error("Error invocating the script processor: "+e.toString());
}
} else
Logger.getLogger("azureus2").error("ConsoleInput class not found. You need the console ui package to use '-e'");