public class PathEditor extends PropertyEditorSupport
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.
Note that, in contrast to FileEditor, relative paths are only
supported by Spring's resource abstraction here. Direct Paths.get
resolution in a file system always has to go through the corresponding
file system provider's scheme, i.e. "file" for the default file system.
Path,
Paths.get(URI),
ResourceEditor,
ResourceLoader,
FileEditor,
URLEditor| Constructor and Description |
|---|
PathEditor()
Create a new PathEditor, using the default ResourceEditor underneath.
|
PathEditor(ResourceEditor resourceEditor)
Create a new PathEditor, using the given ResourceEditor underneath.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAsText() |
void |
setAsText(String text) |
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditorpublic PathEditor()
public PathEditor(ResourceEditor resourceEditor)
resourceEditor - the ResourceEditor to usepublic void setAsText(String text) throws IllegalArgumentException
setAsText in interface PropertyEditorsetAsText in class PropertyEditorSupportIllegalArgumentExceptionpublic String getAsText()
getAsText in interface PropertyEditorgetAsText in class PropertyEditorSupport