@SuppressWarnings("unchecked") private static List<String> getMappingModelList(Archive archive) throws IOException { byte[] zipEntryBytes = archive.getEntryBytes(EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(zipEntryBytes != null) { return getMappingModelList(new ByteArrayInputStream(zipEntryBytes)); } return Collections.EMPTY_LIST; }
@SuppressWarnings("unchecked") private static List<String> getMappingModelList(Archive archive) throws IOException { byte[] zipEntryBytes = archive.getEntryBytes(EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(zipEntryBytes != null) { return getMappingModelList(new ByteArrayInputStream(zipEntryBytes)); } return Collections.EMPTY_LIST; }
@SuppressWarnings("unchecked") private static List<String> getMappingModelList(Archive archive) throws IOException { byte[] zipEntryBytes = archive.getEntryBytes(EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(zipEntryBytes != null) { return getMappingModelList(new ByteArrayInputStream(zipEntryBytes)); } return Collections.EMPTY_LIST; }
@SuppressWarnings("unchecked") private static List<String> getMappingModelList(Archive archive) throws IOException { byte[] zipEntryBytes = archive.getEntryBytes(EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(zipEntryBytes != null) { return getMappingModelList(new ByteArrayInputStream(zipEntryBytes)); } return Collections.EMPTY_LIST; }
private static List<String> getMappingModelList(String urn) throws IOException, EDIConfigurationException { InputStream mappingModelListStream = getMappingModelConfigStream(urn, EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(mappingModelListStream == null) { throw new EDIConfigurationException("Failed to locate jar file for EDI Mapping Model URN '" + urn + "'. Jar must be available on classpath."); } return getMappingModelList(mappingModelListStream); }
private static List<String> getMappingModelList(String urn) throws IOException, EDIConfigurationException { InputStream mappingModelListStream = getMappingModelConfigStream(urn, EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(mappingModelListStream == null) { throw new EDIConfigurationException("Failed to locate jar file for EDI Mapping Model URN '" + urn + "'. Jar must be available on classpath."); } return getMappingModelList(mappingModelListStream); }
private static List<String> getMappingModelList(String urn) throws IOException, EDIConfigurationException { InputStream mappingModelListStream = getMappingModelConfigStream(urn, EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(mappingModelListStream == null) { throw new EDIConfigurationException("Failed to locate jar file for EDI Mapping Model URN '" + urn + "'. Jar must be available on classpath."); } return getMappingModelList(mappingModelListStream); }
private static List<String> getMappingModelList(String urn) throws IOException, EDIConfigurationException { InputStream mappingModelListStream = getMappingModelConfigStream(urn, EDI_MAPPING_MODEL_ZIP_LIST_FILE); if(mappingModelListStream == null) { throw new EDIConfigurationException("Failed to locate jar file for EDI Mapping Model URN '" + urn + "'. Jar must be available on classpath."); } return getMappingModelList(mappingModelListStream); }
private static boolean loadZippedMappingModels(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws IOException, SAXException, EDIConfigurationException { URIResourceLocator locator = new URIResourceLocator(); locator.setBaseURI(baseURI); InputStream rawZipStream = locator.getResource(mappingModelFile); if(rawZipStream != null) { Archive archive = loadArchive(rawZipStream); if(archive != null) { List<String> rootMappingModels = getMappingModelList(archive); if(rootMappingModels.isEmpty()) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model zip file. Check that the zip has a valid '" + EDI_MAPPING_MODEL_ZIP_LIST_FILE + "' mapping list file."); return false; } ClassLoader threadCCL = Thread.currentThread().getContextClassLoader(); try { ArchiveClassLoader archiveClassLoader = new ArchiveClassLoader(threadCCL, archive); Thread.currentThread().setContextClassLoader(archiveClassLoader); loadMappingModels(mappingModels, baseURI, rootMappingModels); } finally { Thread.currentThread().setContextClassLoader(threadCCL); } return true; } } return false; }
private static boolean loadZippedMappingModels(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws IOException, SAXException, EDIConfigurationException { URIResourceLocator locator = new URIResourceLocator(); locator.setBaseURI(baseURI); InputStream rawZipStream = locator.getResource(mappingModelFile); if(rawZipStream != null) { Archive archive = loadArchive(rawZipStream); if(archive != null) { List<String> rootMappingModels = getMappingModelList(archive); if(rootMappingModels.isEmpty()) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model zip file. Check that the zip has a valid '" + EDI_MAPPING_MODEL_ZIP_LIST_FILE + "' mapping list file."); return false; } ClassLoader threadCCL = Thread.currentThread().getContextClassLoader(); try { ArchiveClassLoader archiveClassLoader = new ArchiveClassLoader(threadCCL, archive); Thread.currentThread().setContextClassLoader(archiveClassLoader); loadMappingModels(mappingModels, baseURI, rootMappingModels); } finally { Thread.currentThread().setContextClassLoader(threadCCL); } return true; } } return false; }
private static boolean loadZippedMappingModels(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws IOException, SAXException, EDIConfigurationException { URIResourceLocator locator = new URIResourceLocator(); locator.setBaseURI(baseURI); InputStream rawZipStream = locator.getResource(mappingModelFile); if(rawZipStream != null) { Archive archive = loadArchive(rawZipStream); if(archive != null) { List<String> rootMappingModels = getMappingModelList(archive); if(rootMappingModels.isEmpty()) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model zip file. Check that the zip has a valid '" + EDI_MAPPING_MODEL_ZIP_LIST_FILE + "' mapping list file."); return false; } ClassLoader threadCCL = Thread.currentThread().getContextClassLoader(); try { ArchiveClassLoader archiveClassLoader = new ArchiveClassLoader(threadCCL, archive); Thread.currentThread().setContextClassLoader(archiveClassLoader); loadMappingModels(mappingModels, baseURI, rootMappingModels); } finally { Thread.currentThread().setContextClassLoader(threadCCL); } return true; } } return false; }
private static boolean loadZippedMappingModels(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws IOException, SAXException, EDIConfigurationException { URIResourceLocator locator = new URIResourceLocator(); locator.setBaseURI(baseURI); InputStream rawZipStream = locator.getResource(mappingModelFile); if(rawZipStream != null) { Archive archive = loadArchive(rawZipStream); if(archive != null) { List<String> rootMappingModels = getMappingModelList(archive); if(rootMappingModels.isEmpty()) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model zip file. Check that the zip has a valid '" + EDI_MAPPING_MODEL_ZIP_LIST_FILE + "' mapping list file."); return false; } ClassLoader threadCCL = Thread.currentThread().getContextClassLoader(); try { ArchiveClassLoader archiveClassLoader = new ArchiveClassLoader(threadCCL, archive); Thread.currentThread().setContextClassLoader(archiveClassLoader); loadMappingModels(mappingModels, baseURI, rootMappingModels); } finally { Thread.currentThread().setContextClassLoader(threadCCL); } return true; } } return false; }
List<String> rootMappingModels = getMappingModelList(urn);
List<String> rootMappingModels = getMappingModelList(urn);
List<String> rootMappingModels = getMappingModelList(urn);
List<String> rootMappingModels = getMappingModelList(urn);