org.springframework.core.io.support
Class ResourceArrayPropertyEditor

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

public class ResourceArrayPropertyEditor
extends PropertyEditorSupport

Editor for Resource descriptor arrays, to automatically convert String location patterns (e.g. "file:C:/my*.txt" or "classpath*:myfile.txt") to Resource array properties.

The path may contain ${...} placeholders, to be resolved as system properties: e.g. ${user.dir}.

Delegates to a ResourcePatternResolver, by default a PathMatchingResourcePatternResolver.

Since:
1.1.2
Author:
Juergen Hoeller
See Also:
Resource, ResourcePatternResolver, PathMatchingResourcePatternResolver, SystemPropertyUtils.resolvePlaceholders(java.lang.String), System.getProperty(String)

Constructor Summary
ResourceArrayPropertyEditor()
          Create a new ResourceArrayPropertyEditor with a default PathMatchingResourcePatternResolver.
ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver)
          Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.
 
Method Summary
protected  String resolvePath(String path)
          Resolve the given path, replacing placeholders with corresponding system property values if necessary.
 void setAsText(String text)
           
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceArrayPropertyEditor

public ResourceArrayPropertyEditor()
Create a new ResourceArrayPropertyEditor with a default PathMatchingResourcePatternResolver.

See Also:
PathMatchingResourcePatternResolver

ResourceArrayPropertyEditor

public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver)
Create a new ResourceArrayPropertyEditor with the given ResourcePatternResolver.

Parameters:
resourcePatternResolver - the ResourcePatternResolver to use
Method Detail

setAsText

public void setAsText(String text)
Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport

resolvePath

protected String resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding system property values if necessary.

Parameters:
path - the original file path
Returns:
the resolved file path
See Also:
SystemPropertyUtils.resolvePlaceholders(java.lang.String)


Copyright (c) 2002-2005 The Spring Framework Project.