/** * Private constructor. */ private StandaloneApplicationContext() { resourceLocator = new URIResourceLocator(); ((URIResourceLocator)resourceLocator).setBaseURI(URI.create(URIResourceLocator.SCHEME_CLASSPATH + ":/")); }
/** * Private constructor. */ private StandaloneApplicationContext() { resourceLocator = new URIResourceLocator(); ((URIResourceLocator)resourceLocator).setBaseURI(URI.create(URIResourceLocator.SCHEME_CLASSPATH + ":/")); }
/** * Private constructor. */ private StandaloneApplicationContext() { resourceLocator = new URIResourceLocator(); ((URIResourceLocator)resourceLocator).setBaseURI(URI.create(URIResourceLocator.SCHEME_CLASSPATH + ":/")); }
/** * Public constructor. * @param modelURI The model resource URI. * @param importBaseURI The base URI for loading imports. */ public EDIConfigDigester(URI modelURI, URI importBaseURI) { AssertArgument.isNotNull(importBaseURI, "importBaseURI"); this.modelURI = modelURI; importLocator = new URIResourceLocator(); importLocator.setBaseURI(importBaseURI); }
/** * Public constructor. * @param modelURI The model resource URI. * @param importBaseURI The base URI for loading imports. */ public EDIConfigDigester(URI modelURI, URI importBaseURI) { AssertArgument.isNotNull(importBaseURI, "importBaseURI"); this.modelURI = modelURI; importLocator = new URIResourceLocator(); importLocator.setBaseURI(importBaseURI); }
/** * Public constructor. * @param modelURI The model resource URI. * @param importBaseURI The base URI for loading imports. */ public EDIConfigDigester(URI modelURI, URI importBaseURI) { AssertArgument.isNotNull(importBaseURI, "importBaseURI"); this.modelURI = modelURI; importLocator = new URIResourceLocator(); importLocator.setBaseURI(importBaseURI); }
/** * Public constructor. * @param modelURI The model resource URI. * @param importBaseURI The base URI for loading imports. */ public EDIConfigDigester(URI modelURI, URI importBaseURI) { AssertArgument.isNotNull(importBaseURI, "importBaseURI"); this.modelURI = modelURI; importLocator = new URIResourceLocator(); importLocator.setBaseURI(importBaseURI); }
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; }
public StandaloneApplicationContext(boolean registerInstalledResources) { resourceLocator = new URIResourceLocator(); ((URIResourceLocator)resourceLocator).setBaseURI(URI.create(URIResourceLocator.SCHEME_CLASSPATH + ":/")); resStore = new SmooksResourceConfigurationStore(this, registerInstalledResources); // Add the open profile... profileStore.addProfileSet(new DefaultProfileSet(Profile.DEFAULT_PROFILE)); }
resourceLocator.setBaseURI(baseURI);
resourceLocator.setBaseURI(baseURI);
resourceLocator.setBaseURI(baseURI);
/** * Public constructor. * <p/> * Adds the set of {@link SmooksResourceConfiguration resources} via the {@link #addConfigurations(String)} method, * which resolves the resourceURI parameter using a {@link org.milyn.resource.URIResourceLocator}. * <p/> * Additional resource configurations can be added through calls to * {@link #addConfigurations(String)} or {@link #addConfigurations(String,java.io.InputStream)}. * * @param resourceURI XML resource configuration stream URI. * @throws IOException Error reading resource stream. * @throws SAXException Error parsing the resource stream. * @see SmooksResourceConfiguration */ public Smooks(String resourceURI) throws IOException, SAXException { this(); URIResourceLocator resourceLocator = new URIResourceLocator(); resourceLocator.setBaseURI(URIResourceLocator.extractBaseURI(resourceURI)); context.setResourceLocator(resourceLocator); addConfigurations(resourceURI); }
/** * Public constructor. * <p/> * Adds the set of {@link SmooksResourceConfiguration resources} via the {@link #addConfigurations(String)} method, * which resolves the resourceURI parameter using a {@link org.milyn.resource.URIResourceLocator}. * <p/> * Additional resource configurations can be added through calls to * {@link #addConfigurations(String)} or {@link #addConfigurations(String,java.io.InputStream)}. * * @param resourceURI XML resource configuration stream URI. * @throws IOException Error reading resource stream. * @throws SAXException Error parsing the resource stream. * @see SmooksResourceConfiguration */ public Smooks(String resourceURI) throws IOException, SAXException { this(); URIResourceLocator resourceLocator = new URIResourceLocator(); resourceLocator.setBaseURI(URIResourceLocator.extractBaseURI(resourceURI)); context.setResourceLocator(resourceLocator); addConfigurations(resourceURI); }
/** * Public constructor. * <p/> * Adds the set of {@link SmooksResourceConfiguration resources} via the {@link #addConfigurations(String)} method, * which resolves the resourceURI parameter using a {@link org.milyn.resource.URIResourceLocator}. * <p/> * Additional resource configurations can be added through calls to * {@link #addConfigurations(String)} or {@link #addConfigurations(String,java.io.InputStream)}. * * @param resourceURI XML resource configuration stream URI. * @throws IOException Error reading resource stream. * @throws SAXException Error parsing the resource stream. * @see SmooksResourceConfiguration */ public Smooks(String resourceURI) throws IOException, SAXException { this(); URIResourceLocator resourceLocator = new URIResourceLocator(); resourceLocator.setBaseURI(URIResourceLocator.extractBaseURI(resourceURI)); context.setResourceLocator(resourceLocator); addConfigurations(resourceURI); }
/** * Public constructor. * * Adds the set of {@link SmooksResourceConfiguration resources} via the {@link #addConfigurations(String)} method, * which resolves the resourceURI parameter using a {@link org.milyn.resource.URIResourceLocator}. * * Additional resource configurations can be added through calls to * {@link #addConfigurations(String)} or {@link #addConfigurations(String,java.io.InputStream)}. * * @param resourceURI XML resource configuration stream URI. * @throws IOException Error reading resource stream. * @throws SAXException Error parsing the resource stream. * @see SmooksResourceConfiguration */ public Smooks(String resourceURI) throws IOException, SAXException { this(); URIResourceLocator resourceLocator = new URIResourceLocator(); resourceLocator.setBaseURI(URIResourceLocator.extractBaseURI(resourceURI)); context.setResourceLocator(resourceLocator); addConfigurations(resourceURI); }
URI importBaseURI; resourceLocator.setBaseURI(baseURI); URI resourceURI = resourceLocator.resolveURI(ediMappingModel); importBaseURI = URIResourceLocator.extractBaseURI(resourceURI);