org.springframework.core.io.support

Class ResourceArrayPropertyEditor

  • java.lang.Object
    • java.beans.PropertyEditorSupport
      • org.springframework.core.io.support.ResourceArrayPropertyEditor
  • All Implemented Interfaces:
    java.beans.PropertyEditor


    public class ResourceArrayPropertyEditor
    extends java.beans.PropertyEditorSupport
    Editor for Resource arrays, to automatically convert String location patterns (e.g. "file:C:/my*.txt" or "classpath*:myfile.txt") to Resource array properties. Can also translate a collection or array of location patterns into a merged Resource array.

    A path may contain ${...} placeholders, to be resolved as Environment properties: e.g. ${user.dir}. Unresolvable placeholders are ignored by default.

    Delegates to a ResourcePatternResolver, by default using a PathMatchingResourcePatternResolver.

    Since:
    1.1.2
    Author:
    Juergen Hoeller, Chris Beams
    See Also:
    Resource, ResourcePatternResolver, PathMatchingResourcePatternResolver
    • Method Detail

      • setAsText

        public void setAsText(java.lang.String text)
        Treat the given text as a location pattern and convert it to a Resource array.
        Specified by:
        setAsText in interface java.beans.PropertyEditor
        Overrides:
        setAsText in class java.beans.PropertyEditorSupport
      • setValue

        public void setValue(java.lang.Object value)
                      throws java.lang.IllegalArgumentException
        Treat the given value as a collection or array and convert it to a Resource array. Considers String elements as location patterns and takes Resource elements as-is.
        Specified by:
        setValue in interface java.beans.PropertyEditor
        Overrides:
        setValue in class java.beans.PropertyEditorSupport
        Throws:
        java.lang.IllegalArgumentException