IGitblit gitblit = getContext().getGitblit();
if (id.equalsIgnoreCase("ALL")) {
gitblit.startPlugins();
stdout.println("All plugins started");
} else {
PluginWrapper pluginWrapper = getPlugin(id);
if (pluginWrapper == null) {
throw new UnloggedFailure(String.format("Plugin %s is not installed!", id));
}
PluginState state = gitblit.startPlugin(pluginWrapper.getPluginId());
if (PluginState.STARTED.equals(state)) {
stdout.println(String.format("Started %s", pluginWrapper.getPluginId()));
} else {
throw new UnloggedFailure(1, String.format("Failed to start %s", pluginWrapper.getPluginId()));
}
}
}