Package org.springframework.core.io

Examples of org.springframework.core.io.DefaultResourceLoader


   * Cr�ation la liste de mapping des types
   */
  public void afterPropertiesSet() throws Exception {
    // Recuperer les fichiers de mapping
    List<String> locations = mapper.getMappingFiles();
    DefaultResourceLoader resourcesLoader = new DefaultResourceLoader();

    // Pour chaque fichier, on ajoute la class dans le map
    for( String location : locations ) {

      // Recuperer le fichier
      Resource resource = resourcesLoader.getResource(location);
      InputStream stream = resource.getURL().openStream();
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.parse(stream);
      doc.getDocumentElement().normalize();
View Full Code Here


  /**
   * Create a new LocalizedResourceHelper with a DefaultResourceLoader.
   * @see org.springframework.core.io.DefaultResourceLoader
   */
  public LocalizedResourceHelper() {
    this.resourceLoader = new DefaultResourceLoader();
  }
View Full Code Here

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

      }
    } else if (type == ComponentDeclaration.UIMAFIT_ENGINE) {
      List<String> engines = new ArrayList<String>();
      ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(
              true);
      ResourceLoader resourceLoader = new DefaultResourceLoader(classloader);
      provider.setResourceLoader(resourceLoader);
      provider.addIncludeFilter(new AssignableTypeFilter(AnalysisComponent.class));

      String pack = complString.replaceAll("[.]", "/");
      if (pack.endsWith("/")) {
View Full Code Here

  /**
   * @param resourcePaths Resource paths to search in priority.
   */
  public RutaResourceLoader(String[] resourcePaths) {
    this.wrapped = new PathMatchingResourcePatternResolver(new ResourcePathResourceLoader(resourcePaths));
    this.fallback = new DefaultResourceLoader();
  }
View Full Code Here

   
    abstract protected String getScriptMimeType();
   
    public void setUp() throws Exception
    {
        portletContext = new MockPortletContext(new DefaultResourceLoader());
        portletConfig = new MockPortletConfig(portletContext);
       
        for (Map.Entry<String, String> entry : getPortletInitParameters().entrySet())
        {
            portletConfig.addInitParameter(entry.getKey(), entry.getValue());
View Full Code Here

       
        /*
         * 1. initialize script engine by script engine name
         */
       
        PortletContext portletContext = new MockPortletContext(new DefaultResourceLoader());
        MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
        portletConfig.addInitParameter(ScriptPortlet.ENGINE, scriptEngine);
        if (evalPortletKey != null)
        {
            portletConfig.addInitParameter(ScriptPortlet.EVAL_KEY, evalPortletKey);
        }
        portletConfig.addInitParameter(ScriptPortlet.SOURCE, scriptSource);
       
        ScriptPortlet helloScriptPortlet = new ScriptPortlet();
       
        try
        {
            helloScriptPortlet.init(portletConfig);
            assertTrue(helloScriptPortlet.getScriptSourceLastEvaluated() > 0L);
        }
        catch (PortletException e)
        {
            e.printStackTrace();
            fail("Failed to initialize portlet: " + e);
        }
       
        /*
         * 2. initialize script engine by script file extension
         */
       
        portletContext = new MockPortletContext(new DefaultResourceLoader());
        portletConfig = new MockPortletConfig(portletContext);
        if (evalPortletKey != null)
        {
            portletConfig.addInitParameter(ScriptPortlet.EVAL_KEY, evalPortletKey);
        }
        portletConfig.addInitParameter(ScriptPortlet.SOURCE, scriptSource);
       
        helloScriptPortlet = new ScriptPortlet();
       
        try
        {
            helloScriptPortlet.init(portletConfig);
            assertTrue(helloScriptPortlet.getScriptSourceLastEvaluated() > 0L);
        }
        catch (PortletException e)
        {
            e.printStackTrace();
            fail("Failed to initialize portlet: " + e);
        }
       
        /*
         * 3. initialize script engine by script mime type
         */
       
        portletContext = new MockPortletContext(new DefaultResourceLoader())
        {
            @Override
            public String getMimeType(String filePath)
            {
                return getScriptMimeType();
View Full Code Here

    }

    protected void setUp() throws Exception {
        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
        servletContext = new MockServletContext(new DefaultResourceLoader());

        result = new XSLTResult();
        stack = ValueStackFactory.getFactory().createValueStack();
        ActionContext.getContext().setValueStack(stack);
View Full Code Here

   * Create a new PathMatchingResourcePatternResolver with a DefaultResourceLoader.
   * <p>ClassLoader access will happen via the thread context class loader.
   * @see org.springframework.core.io.DefaultResourceLoader
   */
  public PathMatchingResourcePatternResolver() {
    this.resourceLoader = new DefaultResourceLoader();
  }
View Full Code Here

   * @param classLoader the ClassLoader to load classpath resources with,
   * or <code>null</code> for using the thread context class loader
   * @see org.springframework.core.io.DefaultResourceLoader
   */
  public PathMatchingResourcePatternResolver(ClassLoader classLoader) {
    this.resourceLoader = new DefaultResourceLoader(classLoader);
  }
View Full Code Here

TOP

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

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.