Examples of DefaultResourceLoader


Examples of org.springframework.core.io.DefaultResourceLoader

    /**
     * Constructs a new SaxEmailParser where the {@link DefaultResourceLoader} is used to load the attchment
     * resources.
     */
    public SaxEmailParser() {
        this(new DefaultResourceLoader());
    }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    /**
     * Constructs a new FreemarkerTemplateEngine. The engine uses the default settings of freemarker engine and
     * {@link DefaultResourceLoader} as the resource loader that is used to load all template resources.
     */
    public FreemarkerTemplateEngine() {
        this(new DefaultResourceLoader());
    }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

     * resource loader.
     *
     * @param engine The template engine that will be used to generate the appropriate templates.
     */
    public BasicTemplateResolver(TemplateEngine engine) {
        this(engine, new DefaultResourceLoader());
    }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

      System.setProperty(LogFactory.FACTORY_PROPERTY, "org.apache.commons.logging.impl.Log4jFactory");
        PropertyConfigurator.configure("log4j.properties");
       
      AbstractApplicationContext context = new ClassPathXmlApplicationContext("/applicationContext-repository.xml");
       
        ResourceLoader loader = new DefaultResourceLoader();
        Resource resource = loader.getResource("test.file");
       
        JcrService service = (JcrService)context.getBean("jcrService");

        service.saveSmth();
       
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    protected Resource createResource(Element resourceDefinition) {
        String path = resourceDefinition.getAttribute(LOCATION_ATTR);
        if (!StringUtils.hasText(path)) {
            throw new ValidationConfigurationException("Resoruce path is required and cannot be empty");
        }
        return new DefaultResourceLoader().getResource(path);
    }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    public void setupBeans() throws Exception {
        if (applicationContext != null) {
            return;
        }
        applicationContext = new GenericApplicationContext();
        resourceLoader = new DefaultResourceLoader(configContextClass.getClassLoader());
        for (String beanDefinitionPath : getConfigLocations()) {
            XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(applicationContext);
            Resource resource = resourceLoader.getResource(beanDefinitionPath);
            reader.loadBeanDefinitions(resource);
        }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

        this.fromExchange = fromExchange;
    }

    public void createResource(String resource) {
        if (resource != null) {
            DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
            Resource tempPropertyResource = resourceLoader.getResource(resource);
            if (tempPropertyResource != null && tempPropertyResource.exists()) {
                propertyResource = tempPropertyResource;
                dirty = true;
            }
        }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

            return new UrlResource((URL) res);
        }
        if (res instanceof URI) {
            return new UrlResource(((URI) res).toURL());
        }
        return new DefaultResourceLoader().getResource(res.toString());
    }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

     * @return the {@link org.springframework.test.web.servlet.request.RequestPostProcessor} to use.
     * @throws IOException
     * @throws CertificateException
     */
    public static RequestPostProcessor x509(String resourceName) throws IOException, CertificateException {
        ResourceLoader loader = new DefaultResourceLoader();
        Resource resource = loader.getResource(resourceName);
        InputStream inputStream = resource.getInputStream();
        CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
        X509Certificate certificate = (X509Certificate) certFactory.generateCertificate(inputStream);
        return x509(certificate);
    }
View Full Code Here

Examples of org.springframework.core.io.DefaultResourceLoader

    public void init() {
        try {
            Connection conn = dataSource.getConnection();
            Statement st = conn.createStatement();
            st.execute("drop all objects;");
            st.execute("runscript from '" + new DefaultResourceLoader().getResource("schema.sql").getURL().toString() + "'");
            st.close();
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (IOException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.