if (localMachinesList.size() != 0) {
Iterator<Machine> localMachines = localMachinesList
.iterator();
while (localMachines.hasNext()) {
log.debug("Found machine");
Machine localMachine = localMachines.next();
String pathToExecutable = localMachine
.getPathToExecutable();
String argLine = "-i " + localMachine.getServerId()
+ " -s " + localMachine.getServer().getName();
if (localMachine.getArgLine() != null) {
argLine = argLine + " " + localMachine.getArgLine();
}
String[] split = argLine.split(" ");
String[] cmdarray = new String[split.length + 1 + 0];
cmdarray[0] = pathToExecutable;
System.arraycopy(split, 0, cmdarray, 1, split.length);
String[] envp = null;
File dir = new File(localMachine.getWorkingDirectory());
Process exec = Runtime.getRuntime().exec(cmdarray,
envp, dir);
log.debug("Launched server: " + pathToExecutable);
BufferedReader output = new BufferedReader(
new InputStreamReader(exec.getInputStream()));