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. 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.
Path,
Paths.get(URI),
ResourceEditor,
ResourceLoader,
FileEditor,
URLEditor| 构造器和说明 |
|---|
PathEditor()
Create a new PathEditor, using the default ResourceEditor underneath.
|
PathEditor(org.springframework.core.io.ResourceEditor resourceEditor)
Create a new PathEditor, using the given ResourceEditor underneath.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getAsText() |
void |
setAsText(String text) |
public PathEditor()
public PathEditor(org.springframework.core.io.ResourceEditor resourceEditor)
resourceEditor - the ResourceEditor to usepublic void setAsText(String text) throws IllegalArgumentException
setAsText 在接口中 PropertyEditorsetAsText 在类中 PropertyEditorSupportIllegalArgumentExceptionpublic String getAsText()
getAsText 在接口中 PropertyEditorgetAsText 在类中 PropertyEditorSupport