Package org.springframework.core.io

Examples of org.springframework.core.io.ResourceEditor


    // 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


   * @see org.springframework.beans.propertyeditors.ClassEditor
   * @see org.springframework.beans.propertyeditors.ClassArrayEditor
   * @see org.springframework.core.io.support.ResourceArrayPropertyEditor
   */
  public void registerCustomEditors(PropertyEditorRegistry registry) {
    ResourceEditor baseEditor = new ResourceEditor(this.resourceLoader, this.propertyResolver);
    doRegisterEditor(registry, Resource.class, baseEditor);
    doRegisterEditor(registry, ContextResource.class, baseEditor);
    doRegisterEditor(registry, InputStream.class, new InputStreamEditor(baseEditor));
    doRegisterEditor(registry, InputSource.class, new InputSourceEditor(baseEditor));
    doRegisterEditor(registry, File.class, new FileEditor(baseEditor));
View Full Code Here

  /**
   * Create a new InputStreamEditor,
   * using the default ResourceEditor underneath.
   */
  public InputStreamEditor() {
    this.resourceEditor = new ResourceEditor();
  }
View Full Code Here

  /**
   * Create a new InputStreamEditor,
   * using the default ResourceEditor underneath.
   */
  public InputStreamEditor() {
    this.resourceEditor = new ResourceEditor();
  }
View Full Code Here

  /**
   * Create a new FileEditor,
   * using the default ResourceEditor underneath.
   */
  public FileEditor() {
    this.resourceEditor = new ResourceEditor();
  }
View Full Code Here

  /**
   * Create a new URLEditor, using the default ResourceEditor underneath.
   */
  public URLEditor() {
    this.resourceEditor = new ResourceEditor();
  }
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, this.environment));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
    }
    catch (BeansException ex) {
      logger.error("Failed to set bean properties on servlet '" + getServletName() + "'", ex);
View Full Code Here

   * @see org.springframework.beans.propertyeditors.ClassEditor
   * @see org.springframework.beans.propertyeditors.ClassArrayEditor
   * @see org.springframework.core.io.support.ResourceArrayPropertyEditor
   */
  public void registerCustomEditors(PropertyEditorRegistry registry) {
    ResourceEditor baseEditor = new ResourceEditor(this.resourceLoader, this.propertyResolver);
    doRegisterEditor(registry, Resource.class, baseEditor);
    doRegisterEditor(registry, ContextResource.class, baseEditor);
    doRegisterEditor(registry, InputStream.class, new InputStreamEditor(baseEditor));
    doRegisterEditor(registry, InputSource.class, new InputSourceEditor(baseEditor));
    doRegisterEditor(registry, File.class, new FileEditor(baseEditor));
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 FilterConfigPropertyValues(filterConfig, this.requiredProperties);
      BeanWrapper bw = new BeanWrapperImpl(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

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.