MultiStatus status = new MultiStatus(JspUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(), 0, LaunchingMessages.getString("TomcatLaunchDelegate.6"), null); String[] vars = LaunchVariableUtil.expandStrings("${catalina_home}", status, null); if (status.isOK() && vars != null && vars.length == 1) { String home = vars[0]; IStatus err = null;
IValueVariable variable = DebugPlugin.getDefault().getStringVariableManager().getValueVariable("${catalina_home}"); IStatus err = null; if (variable == null) { err = new Status(IStatus.ERROR, JspUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(), 0, LaunchingMessages.getString("TomcatLaunchDelegate.9"), null); } else { String home = variable.getValue();
	public static String getCatalinaHome() throws CoreException {		MultiStatus status = new MultiStatus(JspUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(), 0, LaunchingMessages.getString("TomcatLaunchDelegate.6"), null); //$NON-NLS-1$		String[] vars = LaunchVariableUtil.expandStrings("${catalina_home}", status, null); //$NON-NLS-1$		if (status.isOK() && vars != null && vars.length == 1) {			String home = vars[0];			IStatus err = null;			if (home != null && home.length() > 0) {				File file = new File(home);				if (file.exists() && file.isDirectory()) {					return home;				} else {					err = new Status(IStatus.ERROR, JspUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(), 0, MessageFormat.format(LaunchingMessages.getString("TomcatLaunchDelegate.7"), new String[]{home}), null); //$NON-NLS-1$				}			} else {				err = new Status(IStatus.ERROR, JspUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(), 0, LaunchingMessages.getString("TomcatLaunchDelegate.8"), null); //$NON-NLS-1$			}			throw new CoreException(err);		}		throw new CoreException(status);	}