Package org.milyn.resource

Examples of org.milyn.resource.URIResourceLocator


    if(smooks == null) {
      synchronized (this) {
          if(smooks == null) {
          smooks = SmooksResource.createSmooksResource();
          smooks.addConfigurations("smooks-resource", new URIResourceLocator().getResource(smooksResource));
          }
    }
    }
     
  ExecutionContext executionContext = smooks.createExecutionContext();
View Full Code Here


     */
    public SmooksHandler(String resource, Map beans) throws IllegalArgumentException, SAXException, IOException, LifecycleResourceException {
  this.smooksResource = resource;
  this.beansMap = beans;
  smooks = SmooksResource.createSmooksResource();
    smooks.addConfigurations("smooks-resource", new URIResourceLocator().getResource(smooksResource));
    }
View Full Code Here

     * @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);
    }
View Full Code Here

     * @throws SAXException Error parsing the resource stream.
     * @see SmooksResourceConfiguration
     */
    public Smooks(InputStream resourceConfigStream) throws IOException, SAXException {
        this();
        context.setResourceLocator(new URIResourceLocator());
        addConfigurations(resourceConfigStream);
    }
View Full Code Here

     */
    public void addConfigurations(String resourceURI) throws IOException, SAXException {
        AssertArgument.isNotNullAndNotEmpty(resourceURI, "resourceURI");

        InputStream resourceConfigStream;
        URIResourceLocator resourceLocator = new URIResourceLocator();

        resourceConfigStream = resourceLocator.getResource(resourceURI);
        try {
            URI resourceURIObj = new URI(resourceURI);
            addConfigurations(URIUtil.getParent(resourceURIObj).toString(), resourceConfigStream);
        } catch (URISyntaxException e) {
            logger.error("Failed to load Smooks resource configuration '" + resourceURI + "'.", e);
View Full Code Here

    public void test_setResourceLocator() throws IOException, SAXException {
        Smooks smooks = new Smooks("classpath:/org/milyn/test_setClassLoader_01.xml");

        // Check that the base URI was properly resolved
        URIResourceLocator resourceLocator = (URIResourceLocator)smooks.getApplicationContext().getResourceLocator();
    assertEquals("classpath:/org/milyn/", resourceLocator.getBaseURI().toString());
    assertEquals("classpath:/org/milyn/somethingelse.xml", resourceLocator.getBaseURI().resolve("somethingelse.xml").toString());
    }
View Full Code Here

      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);
View Full Code Here

    private class ResourceBundleClassLoader extends ClassLoader {
        @Override
        public InputStream getResourceAsStream(String name) {
            try {
                return new URIResourceLocator().getResource(name);
            } catch (IOException e) {
                return null;
            }
        }
View Full Code Here

            if(interchangePropertiesStream == null) {
                throw new EDIConfigurationException("Failed to locate jar file for EDI Mapping Model URN '" + ediMappingModel + "'.  Jar must be available on classpath.");
            }
        } else if(ediMappingModel.endsWith(".jar") || ediMappingModel.endsWith(".zip")) {
            URIResourceLocator locator = new URIResourceLocator();

            InputStream rawZipStream = locator.getResource(ediMappingModel);
            if(rawZipStream != null) {
                Archive archive = loadArchive(rawZipStream);
                if(archive != null) {
                    byte[] bytes = archive.getEntryBytes(EDI_MAPPING_MODEL_INTERCHANGE_PROPERTIES_FILE);
                    if(bytes != null) {
View Full Code Here

   
    /**
     * Public default Constructor.
     */
    public EDIConfigDigester() {     
      importLocator = new URIResourceLocator();
    }
View Full Code Here

TOP

Related Classes of org.milyn.resource.URIResourceLocator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.