Lines 49-54
Link Here
|
49 |
import java.io.InputStreamReader; |
49 |
import java.io.InputStreamReader; |
50 |
import java.io.OutputStreamWriter; |
50 |
import java.io.OutputStreamWriter; |
51 |
import org.netbeans.api.j2ee.core.Profile; |
51 |
import org.netbeans.api.j2ee.core.Profile; |
|
|
52 |
import org.netbeans.modules.j2ee.common.Util; |
52 |
import org.openide.filesystems.FileLock; |
53 |
import org.openide.filesystems.FileLock; |
53 |
import org.openide.filesystems.FileObject; |
54 |
import org.openide.filesystems.FileObject; |
54 |
import org.openide.filesystems.FileUtil; |
55 |
import org.openide.filesystems.FileUtil; |
Lines 85-92
Link Here
|
85 |
*/ |
86 |
*/ |
86 |
public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequired, FileObject dir) throws IOException { |
87 |
public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequired, FileObject dir) throws IOException { |
87 |
String template = null; |
88 |
String template = null; |
88 |
if ((Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile || |
89 |
if (Util.isAtLeastJavaEE6Web(j2eeProfile) && webXmlRequired) { |
89 |
Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) && webXmlRequired) { |
|
|
90 |
template = "web-3.0.xml"; //NOI18N |
90 |
template = "web-3.0.xml"; //NOI18N |
91 |
} else if (Profile.JAVA_EE_5 == j2eeProfile) { |
91 |
} else if (Profile.JAVA_EE_5 == j2eeProfile) { |
92 |
template = "web-2.5.xml"; //NOI18N |
92 |
template = "web-2.5.xml"; //NOI18N |
Lines 116-123
Link Here
|
116 |
*/ |
116 |
*/ |
117 |
public static FileObject createWebFragmentXml(Profile j2eeProfile, FileObject dir) throws IOException { |
117 |
public static FileObject createWebFragmentXml(Profile j2eeProfile, FileObject dir) throws IOException { |
118 |
String template = null; |
118 |
String template = null; |
119 |
if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile || |
119 |
if (Util.isAtLeastJavaEE6Web(j2eeProfile)) { |
120 |
Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { |
|
|
121 |
template = "web-fragment-3.0.xml"; //NOI18N |
120 |
template = "web-fragment-3.0.xml"; //NOI18N |
122 |
} |
121 |
} |
123 |
|
122 |
|
Lines 155-162
Link Here
|
155 |
*/ |
154 |
*/ |
156 |
public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { |
155 |
public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { |
157 |
String template = null; |
156 |
String template = null; |
158 |
if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile || |
157 |
if (Util.isAtLeastJavaEE6Web(j2eeProfile)) { |
159 |
Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { |
|
|
160 |
template = "beans-1.0.xml"; //NOI18N |
158 |
template = "beans-1.0.xml"; //NOI18N |
161 |
} |
159 |
} |
162 |
|
160 |
|
Lines 194-201
Link Here
|
194 |
*/ |
192 |
*/ |
195 |
public static FileObject createValidationXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { |
193 |
public static FileObject createValidationXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { |
196 |
String template = null; |
194 |
String template = null; |
197 |
if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile || |
195 |
if (Util.isAtLeastJavaEE6Web(j2eeProfile)) { |
198 |
Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { |
|
|
199 |
template = "validation.xml"; //NOI18N |
196 |
template = "validation.xml"; //NOI18N |
200 |
} |
197 |
} |
201 |
|
198 |
|
Lines 233-240
Link Here
|
233 |
*/ |
230 |
*/ |
234 |
public static FileObject createConstraintXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { |
231 |
public static FileObject createConstraintXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { |
235 |
String template = null; |
232 |
String template = null; |
236 |
if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile || |
233 |
if (Util.isAtLeastJavaEE6Web(Profile.JAVA_EE_6_FULL)) { |
237 |
Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { |
|
|
238 |
template = "constraint.xml"; //NOI18N |
234 |
template = "constraint.xml"; //NOI18N |
239 |
} |
235 |
} |
240 |
|
236 |
|