Class PathEditor
java.lang.Object
java.beans.PropertyEditorsupport
org.springframework.beans.propertyeditors.PathEditor
- All Implemented Interfaces:
PropertyEditor
Editor for
java.nio.file.Path, to directly populate a Path
property instead of using a string property as bridge.
Based on Paths.get(URI)'s resolution algorithm, checking
registered NIO file system providers, including the default file system
for "file:..." paths. Also supports spring-style URL notation: any fully
qualified standard URL and spring's special "classpath:" pseudo-URL, as
well as spring's context-specific relative file paths. As a fallback, a
path will be resolved in the file system via Paths#get(string)
if no existing context-relative resource could be found.
- since:
- 4.3.2
- Author:
- Juergen Hoeller
- see Also:
-
Constructor summary
ConstructorsConstructorDescriptionCreate a new PathEditor, using the default ResourceEditor underneath.PathEditor(ResourceEditor resourceEditor) Create a new PathEditor, using the given ResourceEditor underneath. -
Method summary
Methods inherited from class PropertyEditorsupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationstring, getsource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setsource, setValue, supportsCustomEditor
-
Constructor Details
-
PathEditor
public PathEditor()Create a new PathEditor, using the default ResourceEditor underneath. -
PathEditor
Create a new PathEditor, using the given ResourceEditor underneath.- Parameters:
resourceEditor- the ResourceEditor to use
-
-
Method Details
-
setAsText
- specified by:
setAsText in interface PropertyEditor- Overrides:
setAsText in class PropertyEditorsupport- Throws:
IllegalArgumentException
-
getAsText
- specified by:
getAsText in interface PropertyEditor- Overrides:
getAsText in class PropertyEditorsupport
-