[573904] Initial jst.web 5.0 facet constants and detectors

Signed-off-by: Nitin Dahyabhai <thatnitind@gmail.com>
diff --git a/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java b/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java
index 2a8182a..5d75854 100644
--- a/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java
+++ b/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 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
@@ -258,6 +258,8 @@
 						version = J2EEVersionConstants.WEB_3_1_ID;
 					} else if (schemaName.indexOf(J2EEConstants.WEBAPP_SCHEMA_4_0) != -1) {
 						version = J2EEVersionConstants.WEB_4_0_ID;
+					} else if (schemaName.indexOf(J2EEConstants.WEBAPP_SCHEMA_5_0) != -1) {
+						version = J2EEVersionConstants.WEB_5_0_ID;
 					}
 				} else if (J2EEConstants.J2EE_NS_URL.equals(namespace)) {
 					String versionAttribute = handler.getRootAttributes().getValue("version"); //$NON-NLS-1$
@@ -396,6 +398,9 @@
 				case J2EEVersionConstants.WEB_4_0_ID:
 					javaEEVersion = J2EEVersionConstants.JEE_8_0_ID;
 					break;
+				case J2EEVersionConstants.WEB_5_0_ID:
+					javaEEVersion = J2EEVersionConstants.JEE_9_0_ID;
+					break;
 				}
 				break;
 		case WEBSERVICES_TYPE:
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java
index d5e8046..756149b 100644
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java
+++ b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2021 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
@@ -341,21 +341,23 @@
            }
         } else if (isWARFile(fileURI)) {
            if (null == versionAttr) {
-              version = J2EEVersionConstants.WEB_2_4_ID;
-           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) {
-              version = J2EEVersionConstants.WEB_2_2_ID;
-           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) {
-              version = J2EEVersionConstants.WEB_2_3_ID;
-           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_4_TEXT)) {
-              version = J2EEVersionConstants.WEB_2_4_ID;
-           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_5_TEXT)) {
-              version = J2EEVersionConstants.WEB_2_5_ID;
-           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) {
-              version = J2EEVersionConstants.WEB_3_0_ID;
-           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_3_1_TEXT)) {
-              version = J2EEVersionConstants.WEB_3_1_ID;
+              version = J2EEVersionConstants.WEB_5_0_ID;
+           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) {
+        	  version = J2EEVersionConstants.WEB_5_0_ID;
            } else if (versionAttr.equals(J2EEVersionConstants.VERSION_4_0_TEXT)) {
         	  version = J2EEVersionConstants.WEB_4_0_ID;
+           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_3_1_TEXT)) {
+               version = J2EEVersionConstants.WEB_3_1_ID;
+           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) {
+               version = J2EEVersionConstants.WEB_3_0_ID;
+           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_5_TEXT)) {
+               version = J2EEVersionConstants.WEB_2_5_ID;
+           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) {
+        	   version = J2EEVersionConstants.WEB_2_4_ID;
+           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) {
+              version = J2EEVersionConstants.WEB_2_3_ID;
+           } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_4_TEXT)) {
+        	   version = J2EEVersionConstants.WEB_2_2_ID;
            }
         } else if (isRARFile(fileURI)) {
            if (null == versionAttr) {
@@ -411,7 +413,10 @@
               version = J2EEVersionConstants.J2EE_1_4_ID;
            }
         } else if (isWARFile(fileURI)) {
-           if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_4_0)) {
+           if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_5_0)) {
+          	  version = J2EEVersionConstants.WEB_5_0_ID;
+           }
+           else if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_4_0)) {
         	  version = J2EEVersionConstants.WEB_4_0_ID;
            } else if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_3_1)) {
               version = J2EEVersionConstants.WEB_3_1_ID;
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java
index f05e357..fb41d14 100644
--- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java
+++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2021 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
@@ -148,7 +148,8 @@
     String WEBAPP_SCHEMA_3_0        =   "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";//$NON-NLS-1$
     String WEBAPP_SCHEMA_3_1        =   "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd";//$NON-NLS-1$
     String WEBAPP_SCHEMA_4_0        =   "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd";//$NON-NLS-1$
-    /** "WEB-INF/ejb-jar.xml"                                                                                              */
+    String WEBAPP_SCHEMA_5_0        =   "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_5_0.xsd";//$NON-NLS-1$
+    /** "WEB-INF/ejb-jar.xml" */
     String EJBJAR_IN_WAR_DD_URI                =   "WEB-INF/ejb-jar.xml"; //$NON-NLS-1$
     //J2C Resource Adapter Constants
     /** "J2CResourceAdapter_ID"                                                                                             */
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEVersionConstants.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEVersionConstants.java
index bc30160..d75b345 100644
--- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEVersionConstants.java
+++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEVersionConstants.java
@@ -50,6 +50,7 @@
 	public int WEB_3_0_ID = 30;
 	public int WEB_3_1_ID = 31;
 	public int WEB_4_0_ID = 40;
+	public int WEB_5_0_ID = 50;
 	public int WEBFRAGMENT_3_0_ID = 30;
 	public int WEBFRAGMENT_3_1_ID = 31;
 	public int WEBFRAGMENT_4_0_ID = 40;
diff --git a/plugins/org.eclipse.jst.j2ee.web/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee.web/META-INF/MANIFEST.MF
index a88aa2b..08199d8 100644
--- a/plugins/org.eclipse.jst.j2ee.web/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.j2ee.web/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Web Plug-in
 Bundle-SymbolicName: org.eclipse.jst.j2ee.web; singleton:=true
-Bundle-Version: 1.1.1000.qualifier
+Bundle-Version: 1.1.1100.qualifier
 Bundle-Activator: org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin
 Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee.web/plugin.xml b/plugins/org.eclipse.jst.j2ee.web/plugin.xml
index 1ed9e36..4a40a51 100644
--- a/plugins/org.eclipse.jst.j2ee.web/plugin.xml
+++ b/plugins/org.eclipse.jst.j2ee.web/plugin.xml
@@ -564,8 +564,8 @@
    <extension
         point="org.eclipse.jst.j2ee.J2EEModelProvider">
         <provider>
-        	<modelProvider factoryClass="org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit"/>	
-      		<facet id="jst.web" versions="2.2,2.3,2.4"/>
+		<modelProvider factoryClass="org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit"/>
+		<facet id="jst.web" versions="2.2,2.3,2.4,2.5"/>
       	</provider>
    </extension>
 </plugin>
diff --git a/plugins/org.eclipse.jst.j2ee.web/pom.xml b/plugins/org.eclipse.jst.j2ee.web/pom.xml
index c5c925c..11fce54 100644
--- a/plugins/org.eclipse.jst.j2ee.web/pom.xml
+++ b/plugins/org.eclipse.jst.j2ee.web/pom.xml
@@ -21,6 +21,6 @@
 
   <groupId>org.eclipse.webtools.javaee</groupId>
   <artifactId>org.eclipse.jst.j2ee.web</artifactId>
-  <version>1.1.1000-SNAPSHOT</version>
+  <version>1.1.1100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/web/project/facet/WebFacetInstallDelegate.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/web/project/facet/WebFacetInstallDelegate.java
index 615d2b8..c2c7711 100644
--- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/web/project/facet/WebFacetInstallDelegate.java
+++ b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/web/project/facet/WebFacetInstallDelegate.java
@@ -23,7 +23,6 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
diff --git a/plugins/org.eclipse.jst.jee.web/plugin.xml b/plugins/org.eclipse.jst.jee.web/plugin.xml
index 9c37bbf..e97b4ce 100644
--- a/plugins/org.eclipse.jst.jee.web/plugin.xml
+++ b/plugins/org.eclipse.jst.jee.web/plugin.xml
@@ -5,14 +5,14 @@
         point="org.eclipse.jst.j2ee.J2EEModelProvider">
       	<provider>
         	<modelProvider factoryClass="org.eclipse.jst.jee.model.internal.Web25MergedModelProviderFactory"/>
-      		<facet id="jst.web" versions="2.5,3.0,3.1,4.0"/>
+      		<facet id="jst.web" versions="2.5,3.0,3.1,4.0,5.0"/>
       	</provider>
    </extension>
    <extension
         point="org.eclipse.jst.j2ee.J2EEModelProvider">
       	<provider>
         	<modelProvider factoryClass="org.eclipse.jst.jee.model.internal.WebFragment30ModelProviderFactory"/>
-      		<facet id="jst.webfragment" versions="3.0,3.1,4.0"/>
+      		<facet id="jst.webfragment" versions="3.0,3.1,4.0,5.0"/>
       	</provider>
    </extension>
  </plugin>
diff --git a/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/contenttype/JEE9ContentDescriber.java b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/contenttype/JEE9ContentDescriber.java
new file mode 100644
index 0000000..a176ffc
--- /dev/null
+++ b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/contenttype/JEE9ContentDescriber.java
@@ -0,0 +1,81 @@
+/*******************************************************************************

+ * Copyright (c) 2001, 2021 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

+ * https://www.eclipse.org/legal/epl-2.0/

+ *

+ * Contributors:

+ * IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.jst.jee.contenttype;

+

+import java.io.IOException;

+import java.io.InputStream;

+

+import org.eclipse.core.runtime.QualifiedName;

+import org.eclipse.core.runtime.content.IContentDescriber;

+import org.eclipse.core.runtime.content.IContentDescription;

+import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek;

+

+/**

+ * A content describer for detecting a jakarta ee module

+ */

+public final class JEE9ContentDescriber implements IContentDescriber {

+	public JEE9ContentDescriber() {

+		super();

+	}

+

+	public final static QualifiedName JEEVERSION = new QualifiedName("jee-version", "9.0"); //$NON-NLS-1$ //$NON-NLS-2$

+

+	public int describe(InputStream contents, IContentDescription description) throws IOException {

+

+		JavaEEQuickPeek quickPeek = new JavaEEQuickPeek(contents);

+		switch (quickPeek.getType()) {

+//		case JavaEEQuickPeek.APPLICATION_CLIENT_TYPE:

+//			switch (quickPeek.getVersion()) {

+//			case JavaEEQuickPeek.JEE_8_0_ID:

+//				return VALID;

+//			}

+//			return INVALID;

+//		case JavaEEQuickPeek.APPLICATION_TYPE:

+//			switch (quickPeek.getVersion()) {

+//			case JavaEEQuickPeek.JEE_8_0_ID:

+//				return VALID;

+//			}

+//			return INVALID;

+//		case JavaEEQuickPeek.EJB_TYPE:

+//			switch (quickPeek.getVersion()) {

+//			case JavaEEQuickPeek.EJB_3_2_ID:

+//				return VALID;

+//			}

+//			return INVALID;

+		case JavaEEQuickPeek.WEB_TYPE:

+			switch (quickPeek.getVersion()) {

+			case JavaEEQuickPeek.WEB_5_0_ID:

+				return VALID;

+			}

+			return INVALID;

+//		case JavaEEQuickPeek.WEBFRAGMENT_TYPE:

+//			switch (quickPeek.getVersion()) {

+//			case JavaEEQuickPeek.WEBFRAGMENT_4_0_ID:

+//				return VALID;

+//			}

+//			return INVALID;

+//		case JavaEEQuickPeek.CONNECTOR_TYPE:

+//			switch (quickPeek.getVersion()) {

+//			case JavaEEQuickPeek.JCA_1_7_ID:

+//				return VALID;

+//			}

+//			return INVALID;

+		}

+

+		return INVALID;

+	}

+

+	public QualifiedName[] getSupportedOptions() {

+

+		return new QualifiedName[] { JEEVERSION };

+	}

+

+}

diff --git a/plugins/org.eclipse.jst.jee/plugin.properties b/plugins/org.eclipse.jst.jee/plugin.properties
index cc61b6c..f4cdd5f 100644
--- a/plugins/org.eclipse.jst.jee/plugin.properties
+++ b/plugins/org.eclipse.jst.jee/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2005, 2017 IBM Corporation and others.
+# Copyright (c) 2005, 2021 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
@@ -32,4 +32,5 @@
 ee8webContentType=Java EE 8 Web Content
 ee8webfragmentContentType=Java EE 8 Web Fragment Content
 ee8earContentType=Java EE 8 EAR Content
-ee8appclientContentType=Java EE 8 Application Client Content
\ No newline at end of file
+ee8appclientContentType=Java EE 8 Application Client Content
+ee9webContentType=Jakarta EE 9 Web Content
diff --git a/plugins/org.eclipse.jst.jee/plugin.xml b/plugins/org.eclipse.jst.jee/plugin.xml
index 8275646..5cd00cb 100644
--- a/plugins/org.eclipse.jst.jee/plugin.xml
+++ b/plugins/org.eclipse.jst.jee/plugin.xml
@@ -598,6 +598,20 @@
   	</extension>
   		  	
   	<extension
+         point="org.eclipse.core.contenttype.contentTypes">
+      <content-type
+            file-names="web.xml"
+            id="ee9webDD"
+            base-type="org.eclipse.core.runtime.xml"
+            name="%ee9webContentType"
+            priority="high">
+         <describer
+               class="org.eclipse.jst.jee.contenttype.JEE9ContentDescriber">
+         </describer>
+      </content-type>
+  	</extension> 
+  	
+  	<extension
         point="org.eclipse.jst.j2ee.J2EEModelProvider">
       	<provider>
         	<modelProvider factoryClass="org.eclipse.jst.jee.model.internal.EAR5ModelProviderFactory"/>	
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java
index 877cd13..ad9de27 100644
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java
+++ b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 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
@@ -217,7 +217,7 @@
 	public void setVisible(boolean visible) {
 		super.setVisible(visible);
 		String javaEEVersion = model.getStringProperty(INewServletClassDataModelProperties.JAVA_EE_VERSION);
-		if("3.0".equals(javaEEVersion) || "3.1".equals(javaEEVersion) || "4.0".equals(javaEEVersion)){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$			
+		if(Double.valueOf(javaEEVersion) >= 3.0) {
 			asyncSupportCheckBox.setVisible(true);
 		}
 		else