blob: bfcba2ae00e43373b7c7065e307e576dc298143d [file] [log] [blame]
/**********************************************************************
* Copyright (c) 2003, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
 *
* Contributors:
* IBM - 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.jst.server.j2ee.IWebModule;
/**
*
*/
public class Tomcat55Handler extends Tomcat50Handler {
public boolean verifyInstallPath(IPath installPath) {
if (installPath == null)
return false;
String s = installPath.lastSegment();
if (s != null && s.startsWith("jakarta-tomcat-") && !s.startsWith("jakarta-tomcat-5.5"))
return false;
return TomcatPlugin.verifyInstallPath(installPath, TomcatPlugin.TOMCAT_55);
}
/**
* Returns true if the given project is supported by this
* server, and false otherwise.
*
* @param project org.eclipse.core.resources.IProject
* @return boolean
*/
public IStatus canAddModule(IWebModule module) {
if ("1.2".equals(module.getJ2EESpecificationVersion()) || "1.3".equals(module.getJ2EESpecificationVersion()) || "1.4".equals(module.getJ2EESpecificationVersion()))
return new Status(IStatus.OK, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%canAddModule"), null);
return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, TomcatPlugin.getResource("%errorSpec55"), null);
}
}