org.springframework.beans.propertyeditors
public class: InputStreamEditor [javadoc |
source]
java.lang.Object
java.beans.PropertyEditorSupport
org.springframework.beans.propertyeditors.InputStreamEditor
All Implemented Interfaces:
PropertyEditor
One-way PropertyEditor, which can convert from a text string to a
java.io.InputStream, allowing InputStream properties
to be set directly as a text string.
Supports Spring-style URL notation: any fully qualified standard URL
("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL.
Note that in the default usage, the stream is not closed by Spring itself!
| Method from org.springframework.beans.propertyeditors.InputStreamEditor Summary: |
|---|
|
getAsText, setAsText |
| Methods from java.beans.PropertyEditorSupport: |
|---|
|
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText, setSource, setValue, supportsCustomEditor |
| Method from org.springframework.beans.propertyeditors.InputStreamEditor Detail: |
public String getAsText() {
return null;
}
This implementation returns null to indicate that
there is no appropriate text representation. |
public void setAsText(String text) throws IllegalArgumentException {
this.resourceEditor.setAsText(text);
Resource resource = (Resource) this.resourceEditor.getValue();
try {
setValue(resource != null ? resource.getInputStream() : null);
}
catch (IOException ex) {
throw new IllegalArgumentException(
"Could not retrieve InputStream for " + resource + ": " + ex.getMessage());
}
}
|