|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.beans.PropertyEditorSupport
org.springframework.core.io.support.ResourceArrayPropertyEditor
public class ResourceArrayPropertyEditor
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.
The path may contain ${...}
placeholders, to be resolved
as system properties: e.g. ${user.dir}
.
Delegates to a ResourcePatternResolver
,
by default using a PathMatchingResourcePatternResolver
.
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 java.lang.String |
resolvePath(java.lang.String path)
Resolve the given path, replacing placeholders with corresponding system property values if necessary. |
void |
setAsText(java.lang.String text)
Treat the given text as location pattern and convert it to a Resource array. |
void |
setValue(java.lang.Object value)
Treat the given value as collection or array and convert it to a Resource array. |
Methods inherited from class java.beans.PropertyEditorSupport |
---|
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceArrayPropertyEditor()
PathMatchingResourcePatternResolver
public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver)
resourcePatternResolver
- the ResourcePatternResolver to useMethod Detail |
---|
public void setAsText(java.lang.String text)
setAsText
in interface java.beans.PropertyEditor
setAsText
in class java.beans.PropertyEditorSupport
public void setValue(java.lang.Object value) throws java.lang.IllegalArgumentException
setValue
in interface java.beans.PropertyEditor
setValue
in class java.beans.PropertyEditorSupport
java.lang.IllegalArgumentException
protected java.lang.String resolvePath(java.lang.String path)
path
- the original file path
SystemPropertyUtils.resolvePlaceholders(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |