public void execute(IProgressMonitor monitor, IAdaptable info) throws CoreException {
IServerWorkingCopy wc = null;
IServer server2 = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
if (server2 instanceof IServerWorkingCopy)
wc = (IServerWorkingCopy) server2;
else
wc = server2.createWorkingCopy();
TomcatServer server = (TomcatServer) wc.loadAdapter(TomcatServer.class, monitor);
TomcatConfiguration configuration = server.getTomcatConfiguration();
if (configuration.getWebModules().size() <= index)
return;
module = (WebModule) configuration.getWebModules().get(index);
if (contextRoot != null && !contextRoot.startsWith("/") && contextRoot.length() > 0)
contextRoot = "/" + contextRoot;
if (!contextRoot.equals(module.getPath())) {
configuration.modifyWebModule(index, module.getDocumentBase(), contextRoot, module.isReloadable());
wc.save(true, monitor);
}
}