Package org.springframework.core.io

Examples of org.springframework.core.io.ResourceEditor


     *
     * @param resourceName
     * @return
     */
    public static SpringBrokerContainerFactory newFactory(String resourceName) {
        ResourceEditor editor = new ResourceEditor();
        editor.setAsText(resourceName);
        Resource resource = (Resource) editor.getValue();
        if (resource == null) {
            throw new IllegalArgumentException("Could not convert '" + resourceName + "' into a Spring Resource");
        }
        return new SpringBrokerContainerFactory(resource);
    }
View Full Code Here


     *
     * @param resourceName
     * @return
     */
    public static SpringBrokerContainerFactory newFactory(String resourceName) {
        ResourceEditor editor = new ResourceEditor();
        editor.setAsText(resourceName);
        Resource resource = (Resource) editor.getValue();
        if (resource == null) {
            throw new IllegalArgumentException("Could not convert '" + resourceName + "' into a Spring Resource");
        }
        return new SpringBrokerContainerFactory(resource);
    }
View Full Code Here

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

     * @param placeholderSuffix the placeholder suffix String
     */
    public static void processLocation(String locationName,
            String placeholderPrefix, String placeholderSuffix)
    {
        ResourceEditor resourceEditor = new ResourceEditor();
        resourceEditor.setAsText(locationName);

        PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
        configurer.setLocation((Resource) resourceEditor.getValue());
        if (placeholderPrefix != null)
            configurer.setPlaceholderPrefix(placeholderPrefix);
        if (placeholderSuffix != null)
            configurer.setPlaceholderSuffix(placeholderSuffix);

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

        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

        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

     * @param placeholderSuffix the placeholder suffix String
     */
    public static void processLocation(String locationName,
            String placeholderPrefix, String placeholderSuffix)
    {
        ResourceEditor resourceEditor = new ResourceEditor();
        resourceEditor.setAsText(locationName);

        PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
        configurer.setLocation((Resource) resourceEditor.getValue());
        if (placeholderPrefix != null)
            configurer.setPlaceholderPrefix(placeholderPrefix);
        if (placeholderSuffix != null)
            configurer.setPlaceholderSuffix(placeholderSuffix);
        configurer.quiet = true;
View Full Code Here

     *
     * @param resourceName
     * @return
     */
    public static SpringBrokerContainerFactory newFactory(String resourceName) {
        ResourceEditor editor = new ResourceEditor();
        editor.setAsText(resourceName);
        Resource resource = (Resource) editor.getValue();
        if (resource == null) {
            throw new IllegalArgumentException("Could not convert '" + resourceName + "' into a Spring Resource");
        }
        return new SpringBrokerContainerFactory(resource);
    }
View Full Code Here

     *
     * @param resourceName
     * @return
     */
    public static SpringBrokerContainerFactory newFactory(String resourceName) {
        ResourceEditor editor = new ResourceEditor();
        editor.setAsText(resourceName);
        Resource resource = (Resource) editor.getValue();
        if (resource == null) {
            throw new IllegalArgumentException("Could not convert '" + resourceName + "' into a Spring Resource");
        }
        return new SpringBrokerContainerFactory(resource);
    }
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.