String[] expansion = LaunchVariableUtil.expandStrings(workingDirPath, null, null); if (expansion.length == 1) { String path = expansion[0]; if (path != null) { workingDirPath = path; }
String expansion; try { expansion = DebugPlugin.getDefault().getStringVariableManager().performStringSubstitution(workingDirPath); } catch (CoreException e) { setErrorMessage(e.getMessage()); return false;
	public boolean isValid(ILaunchConfiguration config) {		setErrorMessage(null);		setMessage(null);				String workingDirPath = fTomcatDir.getText().trim();		// resolve variables (if any)		String[] expansion = LaunchVariableUtil.expandStrings(workingDirPath, null, null);		if (expansion.length == 1) {			String path = expansion[0];			if (path != null) {				workingDirPath = path;			}		}		if (workingDirPath.length() > 0) {			File dir = new File(workingDirPath);			if (!dir.exists()) {				setErrorMessage(LaunchingMessages.getString("TomcatTab.5")); //$NON-NLS-1$				return false;			}			if (!dir.isDirectory()) {				setErrorMessage(LaunchingMessages.getString("TomcatTab.6")); //$NON-NLS-1$				return false;			}		}					String webappDirPath = fWebAppDir.getText().trim();		if (webappDirPath.length() > 0) {			IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(webappDirPath));			if (resource == null) {				setErrorMessage(LaunchingMessages.getString("TomcatTab.30")); //$NON-NLS-1$				return false;			}			if (!(resource instanceof IContainer)) {				setErrorMessage(LaunchingMessages.getString("TomcatTab.31")); //$NON-NLS-1$				return false;			}		}								return true;	}