java.io.File, to directly populate a File property
from a Spring resource location.
Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL.
Note
The behavior of this editor has changed in Spring 2.0. Previously, it created a File instance directly from a filename. As of Spring 2.0, it takes a standard Spring resource location as input; this is consistent with URLEditor and InputStreamEditor now.
Note
In Spring 2.5 the following modification was made. If a file name is specified without a URL prefix or without an absolute path then we try to locate the file using standard ResourceLoader semantics. If the file was not found, then a File instance is created assuming the file name refers to a relative file location.
java.io.File , org.springframework.core.io.ResourceEditor , org.springframework.core.io.ResourceLoader , URLEditor, InputStreamEditor
| Modifier and Type | Field and Description |
|---|---|
| private final ResourceEditor |
| Access | Constructor and Description |
|---|---|
| public | |
| public | FileEditor(ResourceEditor
the ResourceEditor to use resourceEditor)Create a new FileEditor, using the given ResourceEditor underneath. |
| Modifier and Type | Method and Description |
|---|---|
| public String | getAsText()
Overrides java. Implements java. |
| public void | setAsText(String
The string to be parsed. text)Overrides java. Implements java. |
| resourceEditor | back to summary |
|---|---|
| private final ResourceEditor resourceEditor | |
| FileEditor | back to summary |
|---|---|
| public FileEditor() Create a new FileEditor, using a default ResourceEditor underneath. | |
| FileEditor | back to summary |
|---|---|
| public FileEditor(ResourceEditor resourceEditor) Create a new FileEditor, using the given ResourceEditor underneath.
| |
| getAsText | back to summary |
|---|---|
| public String getAsText() Overrides java. Implements java. Doc from java. Gets the property value as a string suitable for presentation to a human to edit. | |
| setAsText | back to summary |
|---|---|
| public void setAsText(String text) throws IllegalArgumentException Overrides java. Implements java. Doc from java. Sets the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text. | |