Package org.springframework.core.io

Examples of org.springframework.core.io.ResourceEditor


  public void setPersistenceXmlLocations(String... persistenceXmlLocations)
  {
      ValidationUtils.assertNotNull(persistenceXmlLocations, "persistenceXmlLocations cannot be null");
        List<String> goodLocations = new ArrayList<String>();

        ResourceEditor editor = new ResourceEditor();
        for (String location : persistenceXmlLocations)
        {
            if (location == null || location.isEmpty())
                continue;

            editor.setAsText(location);
            Resource resource = (Resource) editor.getValue();
            if (resource != null && resource.exists())
            {
                log.debug("using valid persistence XML location: " + location);
                goodLocations.add(location);
            }
View Full Code Here


            {
                resource = (Resource) value;
            }
            else
            {
                ResourceEditor editor = new ResourceEditor();
                key = value.toString();
                editor.setAsText(key);
                resource = (Resource) editor.getValue();
            }
        }
        BeanFactory context = loadContext(resource, key);
        Context answer = (Context) context.getBean("jndi");
        if (answer == null)
View Full Code Here

        try {
            PropertyValues pvs = new FilterConfigPropertyValues(getFilterConfig(), requiredProperties);
            BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
            ResourceLoader resourceLoader = new ServletContextResourceLoader(getServletContext());
            bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
            initBeanWrapper(bw);
            bw.setPropertyValues(pvs, true);
        } catch (Exception e) {
            throw new ServletException("Failed to set bean properties on filter: " + getFilterName(), e);
        }
View Full Code Here

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new FilterConfigPropertyValues(filterConfig, this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(filterConfig.getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader, this.environment));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
    }
    catch (BeansException ex) {
      String msg = "Failed to set bean properties on filter '" +
View Full Code Here

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new ServletConfigPropertyValues(getServletConfig(), this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader, getEnvironment()));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
    }
    catch (BeansException ex) {
      logger.error("Failed to set bean properties on servlet '" + getServletName() + "'", ex);
View Full Code Here

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new PortletConfigPropertyValues(getPortletConfig(), this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new PortletContextResourceLoader(getPortletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader, getEnvironment()));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
    }
    catch (BeansException ex) {
      logger.error("Failed to set bean properties on portlet '" + getPortletName() + "'", ex);
View Full Code Here

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new ServletConfigPropertyValues(getServletConfig(), this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
    }
    catch (BeansException ex) {
      logger.error("Failed to set bean properties on servlet '" + getServletName() + "'", ex);
View Full Code Here

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new FilterConfigPropertyValues(filterConfig, this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(filterConfig.getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
    }
    catch (BeansException ex) {
      String msg = "Failed to set bean properties on filter '" +
View Full Code Here

  public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound) {
    eppc.setIgnoreResourceNotFound(ignoreResourceNotFound);
  }
 
  public void setLocation(String location) {
    ResourceEditor editor = (ResourceEditor) BeanUtils.findEditorByConvention(Resource.class);
    this.resources = new Resource[] {locationStringToResource(location, editor)};
  }
View Full Code Here

    this.resources = new Resource[] {locationStringToResource(location, editor)};
  }
 
  public void setLocations(String[] locations) {
   
    ResourceEditor editor = (ResourceEditor) BeanUtils.findEditorByConvention(Resource.class);
    Resource[] resources = new Resource[locations.length];
    for (int i = 0; i < locations.length; i++) {
      resources[i] = locationStringToResource(locations[i], editor);
    }
    this.resources = resources;
View Full Code Here

TOP

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

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.