Package org.springframework.core.io

Examples of org.springframework.core.io.UrlResource


                    String str = "http://timefinder.sourceforge.net/files/comp-2007-2-09.tim";
                    bar.setMessage(tr.get("downloadFrom", str));
                    // why does decompressing not work?? -> first line == null !?
                    // reader = new InputStreamReader(new ZipInputStream(
                    //          new UrlResource("http://timefinder.sourceforge.net/files/comp-2007-2-09.zip").getInputStream()));
                    reader = new InputStreamReader(new UrlResource(str).getInputStream());
                    bar.setMessage("");
                }

                track2allData.setSource(reader);
                track2allData.setStatusBar(new StatusBarBridge(bar));
View Full Code Here


                int resultDownload = JOptionPane.showConfirmDialog(null, tr.get(ID + ".downloadQuestion"),
                        tr.get(ID + ".downloadQuestion"), JOptionPane.YES_NO_OPTION);
                if (resultDownload == JOptionPane.YES_OPTION) {
                    String str = "http://peat_hal.users.sourceforge.net/sessions_catalog.j1";
                    bar.setMessage(tr.get("downloadFrom", str));
                    istream = new UrlResource(str).getInputStream();
                    pm.worked(5);
                    bar.setMessage("");
                }

                pm.taskStarted(tr.get(ID + ".startTask"), -1);
View Full Code Here

    {
      log.debug("Creating Spring beans factory for extensions registry "
          + registryId + " using "+ resourceLocation);
    }
   
    return new XmlBeanFactory(new UrlResource(resourceLocation));
  }
View Full Code Here

        if (null == beanFactories) {
            beanFactories = new HashMap<UrlResource, CeltixXmlBeanFactory>();
        }

        CeltixXmlBeanFactory beanFactory =  null;
        UrlResource urlRes = getBeanDefinitionsResource();
        if (null != urlRes) {
            if (!beanFactories.containsKey(urlRes)) {

                if (null != urlRes) {
                    try {
                        beanFactory = new CeltixXmlBeanFactory(urlRes);
                    } catch (BeansException ex) {
                        // continue without using configuration from the bean definitions
                        LOG.log(Level.WARNING, new Message("BEAN_FACTORY_CREATION_MSG", LOG, urlRes
                                                           .toString()).toString(), ex);
                    }
                    beanFactories.put(urlRes, beanFactory);
                }
            } else {
View Full Code Here

     * @return
     */

    protected UrlResource getBeanDefinitionsResource() {

        UrlResource urlRes = null;
        String url = System.getProperty(CONFIG_FILE_PROPERTY_NAME);
        if (null != url) {
            try {
                urlRes = new UrlResource(url);
            } catch (MalformedURLException ex) {
                // continue using default configuration
                LOG.log(Level.WARNING, new Message("MALFORMED_URL_MSG", LOG, url).toString(), ex);
            }

View Full Code Here

    }
   
    public void testConstructor() {
      
        URL url = CeltixXmlBeanFactoryTest.class.getResource("resources/top2.xml");  
        UrlResource urlRes = new UrlResource(url);
        CeltixXmlBeanFactory bf = new CeltixXmlBeanFactory(urlRes);
       
        assertNotNull(bf);
      
    }
View Full Code Here

    }
   
    public void testCustomEditorRegistration() {
       
        URL url = CeltixXmlBeanFactoryTest.class.getResource("resources/top2.xml");
        UrlResource urlRes = new UrlResource(url);
        CeltixXmlBeanFactory bf = new CeltixXmlBeanFactory(urlRes);
        Configuration top = new TopConfigurationBuilder().build("top22");
       
        Map map = bf.getCustomEditors();
       
View Full Code Here

    }
   
    public void testPropertyEditorConversionFailure() throws InvocationTargetException,
        NoSuchMethodException, IllegalAccessException {
        URL url = CustomPropertyEditorsTest.class.getResource("resources/top3.xml");
        UrlResource urlRes = new UrlResource(url);
        CeltixXmlBeanFactory bf = new CeltixXmlBeanFactory(urlRes);
        Configuration top = new TopConfigurationBuilder().build("top3");
        bf.registerCustomEditors(top);
        Configuration leaf = new LeafConfigurationBuilder().build(top, "leaf");
        bf.registerCustomEditors(leaf);
View Full Code Here

  }

  protected void refreshSessionFactory() {
    Set<Resource> cfgs = CollectUtils.newHashSet();
    for (URL config : configs) {
      cfgs.add(new UrlResource(config));
    }
    Resource[] configLocations = new Resource[cfgs.size()];
    cfgs.toArray(configLocations);
    setConfigLocations(configLocations);
    try {
View Full Code Here

  public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
    if (null == resource || resource.isEmpty()) return;
    BeanDefinitionReader reader = new BeanDefinitionReader();
    for (URL url : resource.getAllPaths()) {
      List<ReconfigBeanDefinitionHolder> holders = reader.load(new UrlResource(url));
      for (ReconfigBeanDefinitionHolder holder : holders) {
        if (holder.getConfigType().equals(ReconfigType.REMOVE)) {
        } else {
          BeanDefinition definition = null;
          try {
View Full Code Here

TOP

Related Classes of org.springframework.core.io.UrlResource

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.