public void restart() throws IOException, InterruptedException {
File me = getHudsonWar();
File home = me.getParentFile();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StreamTaskListener task = new StreamTaskListener(baos);
task.getLogger().println("Restarting a service");
File executable = new File(home, "hudson.exe");
if (!executable.exists()) executable = new File(home, "jenkins.exe");
int r = new LocalLauncher(task).launch().cmds(executable, "restart")
.stdout(task).pwd(home).join();