version = J2EEVersionConstants.WEB_2_4_ID; } else if (moduleFile.isRARFile()) { if (publicID.equals(J2EEConstants.CONNECTOR_PUBLICID_1_0) && (systemID.equals(J2EEConstants.CONNECTOR_SYSTEMID_1_0)||systemID.equals(J2EEConstants.CONNECTOR_ALT_SYSTEMID_1_0))) { version = J2EEVersionConstants.JCA_1_0_ID;
private static int lookupVersion(ModuleFile moduleFile, String schemaName) { int version = -1; if (moduleFile.isEARFile()) { if (schemaName.equals(J2EEConstants.APPLICATION_SCHEMA_1_4)) { version = J2EEVersionConstants.J2EE_1_4_ID; } } else if (moduleFile.isEJBJarFile()) { if ((schemaName.indexOf(J2EEConstants.EJBJAR_SCHEMA_2_1_NS)) != -1) { version = J2EEVersionConstants.EJB_2_1_ID; } } else if (moduleFile.isApplicationClientFile()) { if (schemaName.equals(J2EEConstants.APP_CLIENT_SCHEMA_1_4)) { version = J2EEVersionConstants.J2EE_1_4_ID; } } else if (moduleFile.isWARFile()) { if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_2_4)) { version = J2EEVersionConstants.WEB_2_4_ID; } } else if (moduleFile.isRARFile()) { if (schemaName.equals(J2EEConstants.CONNECTOR_SCHEMA_1_5)) { version = J2EEVersionConstants.JCA_1_5_ID; } } return version; }
public static boolean isJ2EE13FastCheck(ModuleFile moduleFile) { if (moduleFile == null) return false; else if (moduleFile.isRARFile()) return true; InputStream in = null; String uri = moduleFile.getDeploymentDescriptorUri(); try { in = moduleFile.getInputStream(uri); DocumentType docType = XmlDocumentReader.readDocumentType(in, uri); if (docType == null) return false; String[] ids = getJ2EE13PublicAndSystemIdFor(moduleFile); if (ids == null) return false; return ids[0].equals(docType.getPublicId()) && ids[1].equals(docType.getSystemId()); } catch (IOException ex) { return false; } finally { try { if (in != null) in.close(); } catch (IOException ex) { //Ignore } } }
public static boolean isJ2EE13FastCheck(ModuleFile moduleFile) { if (moduleFile == null) return false; else if (moduleFile.isRARFile()) return true; InputStream in = null; String uri = moduleFile.getDeploymentDescriptorUri(); try { in = moduleFile.getInputStream(uri); DocumentType docType = XmlDocumentReader.readDocumentType(in, uri); if (docType == null) return false; String[] ids = getJ2EE13PublicAndSystemIdFor(moduleFile); if (ids == null) return false; return ids[0].equals(docType.getPublicId()) && ids[1].equals(docType.getSystemId()); } catch (IOException ex) { return false; } finally { try { if (in != null) in.close(); } catch (IOException ex) { //Ignore } } }
version = J2EEVersionConstants.WEB_2_4_ID; } else if (moduleFile.isRARFile()) { if (null == versionAttr) { version = J2EEVersionConstants.JCA_1_5_ID;
protected static String[] getJ2EE13PublicAndSystemIdFor(ModuleFile moduleFile) { if (moduleFile.isEARFile()) return new String[]{J2EEConstants.APPLICATION_PUBLICID_1_3, J2EEConstants.APPLICATION_SYSTEMID_1_3}; else if (moduleFile.isEJBJarFile()) return new String[]{J2EEConstants.EJBJAR_PUBLICID_2_0, J2EEConstants.EJBJAR_SYSTEMID_2_0}; else if (moduleFile.isApplicationClientFile()) return new String[]{J2EEConstants.APP_CLIENT_PUBLICID_1_3, J2EEConstants.APP_CLIENT_SYSTEMID_1_3}; else if (moduleFile.isWARFile()) return new String[]{J2EEConstants.WEBAPP_PUBLICID_2_3, J2EEConstants.WEBAPP_SYSTEMID_2_3}; else if (moduleFile.isRARFile()) return new String[]{J2EEConstants.CONNECTOR_PUBLICID_1_0, J2EEConstants.CONNECTOR_SYSTEMID_1_0}; else return null; }
protected static String[] getJ2EE13PublicAndSystemIdFor(ModuleFile moduleFile) { if (moduleFile.isEARFile()) return new String[]{J2EEConstants.APPLICATION_PUBLICID_1_3, J2EEConstants.APPLICATION_SYSTEMID_1_3}; else if (moduleFile.isEJBJarFile()) return new String[]{J2EEConstants.EJBJAR_PUBLICID_2_0, J2EEConstants.EJBJAR_SYSTEMID_2_0}; else if (moduleFile.isApplicationClientFile()) return new String[]{J2EEConstants.APP_CLIENT_PUBLICID_1_3, J2EEConstants.APP_CLIENT_SYSTEMID_1_3}; else if (moduleFile.isWARFile()) return new String[]{J2EEConstants.WEBAPP_PUBLICID_2_3, J2EEConstants.WEBAPP_SYSTEMID_2_3}; else if (moduleFile.isRARFile()) return new String[]{J2EEConstants.CONNECTOR_PUBLICID_1_0, J2EEConstants.CONNECTOR_SYSTEMID_1_0}; else return null; }
protected Module createModuleForCopying(ModuleFile aModuleFile) { Module aModule = null; if (aModuleFile.isWARFile()) { aModule = getApplicationFactory().createWebModule(); } else if (aModuleFile.isEJBJarFile()) { aModule = getApplicationFactory().createEjbModule(); } else if (aModuleFile.isApplicationClientFile()) { aModule = getApplicationFactory().createJavaClientModule(); } else if (aModuleFile.isRARFile()) { aModule = getApplicationFactory().createConnectorModule(); } aModule.setUri(aModuleFile.getURI()); return aModule; }