}
protected ILaunchConfiguration getLaunchConfiguration(String host, int port, int timeout, String appName,
String launchName) {
try {
ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurationType(CloudFoundryDebuggingLaunchConfigDelegate.LAUNCH_CONFIGURATION_ID);
if (launchConfigType != null) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(appName);
// Create the launch configuration, whether the project exists
// or not, as there may
// not be a local project associated with the deployed app
ILaunchConfiguration configuration = launchConfigType.newInstance(project, launchName);
ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
if (project != null && project.isAccessible()) {
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());