public IServer createServer() throws CoreException {
Assert.isTrue(server == null, "createServer() already invoked");
server = handler.createServer(new NullProgressMonitor(), ServerHandler.ALWAYS_OVERWRITE);
IServerWorkingCopy serverWC = server.createWorkingCopy();
CloudFoundryServer cloudFoundryServer = (CloudFoundryServer) serverWC.loadAdapter(CloudFoundryServer.class,
null);
CredentialProperties credentials = getCredentials();
cloudFoundryServer.setPassword(credentials.password);
cloudFoundryServer.setUsername(credentials.userEmail);
cloudFoundryServer.setUrl(getUrl());
setDefaultCloudSpace(cloudFoundryServer, credentials.organization, credentials.space);
serverWC.save(true, null);
return server;