blob: 3f4bc048fb4c570db80693508b03425ddbd8ad57 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2003, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
package org.eclipse.jst.server.tomcat.core.internal;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IModule;
/**
* Tomcat 55 handler.
*/
public class Tomcat55Handler extends Tomcat50Handler {
/**
* @see ITomcatVersionHandler#verifyInstallPath(IPath)
*/
public IStatus verifyInstallPath(IPath installPath) {
IStatus result = TomcatVersionHelper.checkCatalinaVersion(installPath, TomcatPlugin.TOMCAT_55);
// If check was canceled, use folder check
if (result.getSeverity() == IStatus.CANCEL) {
result = TomcatPlugin.verifyInstallPathWithFolderCheck(installPath, TomcatPlugin.TOMCAT_55);
}
return result;
}
/**
* @see ITomcatVersionHandler#canAddModule(IModule)
*/
public IStatus canAddModule(IModule module) {
String version = module.getModuleType().getVersion();
if ("2.2".equals(version) || "2.3".equals(version) || "2.4".equals(version))
return Status.OK_STATUS;
return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, Messages.errorSpec55, null);
}
}