}
return server;
}
private static Set<IServer> getAllServers(IProject project) {
IModule module = org.eclipse.wst.server.core.ServerUtil.getModule(project);
if (module==null) {
// if there's no module for a project then there's no IServer for sure - which
// is what we need to create a RepositoryInfo
return null;
}
Set<IServer> result = new HashSet<IServer>();
IServer defaultServer = ServerCore.getDefaultServer(module);
if (defaultServer!=null) {
result.add(defaultServer);
}
IServer[] allServers = ServerCore.getServers();
for (int i = 0; i < allServers.length; i++) {
IServer aServer = allServers[i];
IModule[] allModules = aServer.getModules();
for (int j = 0; j < allModules.length; j++) {
IModule aMoudle = allModules[j];
if (aMoudle.equals(module)) {
result.add(aServer);
break;
}
}
}