org.springframework.beans.propertyeditors

Class InputStreamEditor

  • java.lang.Object
    • java.beans.PropertyEditorSupport
      • org.springframework.beans.propertyeditors.InputStreamEditor
  • All Implemented Interfaces:
    java.beans.PropertyEditor


    public class InputStreamEditor
    extends java.beans.PropertyEditorSupport
    One-way PropertyEditor which can convert from a text String to a java.io.InputStream, interpreting the given String as a Spring resource location (e.g. a URL String).

    Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc.) and Spring's special "classpath:" pseudo-URL.

    Note that such streams usually do not get closed by Spring itself!

    Since:
    1.0.1
    Author:
    Juergen Hoeller
    See Also:
    InputStream, ResourceEditor, ResourceLoader, URLEditor, FileEditor
    • Constructor Summary

      Constructors 
      Constructor and Description
      InputStreamEditor()
      Create a new InputStreamEditor, using the default ResourceEditor underneath.
      InputStreamEditor(ResourceEditor resourceEditor)
      Create a new InputStreamEditor, using the given ResourceEditor underneath.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getAsText()
      This implementation returns null to indicate that there is no appropriate text representation.
      void setAsText(java.lang.String text) 
      • Methods inherited from class java.beans.PropertyEditorSupport

        addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InputStreamEditor

        public InputStreamEditor()
        Create a new InputStreamEditor, using the default ResourceEditor underneath.
      • InputStreamEditor

        public InputStreamEditor(ResourceEditor resourceEditor)
        Create a new InputStreamEditor, using the given ResourceEditor underneath.
        Parameters:
        resourceEditor - the ResourceEditor to use
    • Method Detail

      • setAsText

        public void setAsText(java.lang.String text)
                       throws java.lang.IllegalArgumentException
        Specified by:
        setAsText in interface java.beans.PropertyEditor
        Overrides:
        setAsText in class java.beans.PropertyEditorSupport
        Throws:
        java.lang.IllegalArgumentException
      • getAsText

        @Nullable
        public java.lang.String getAsText()
        This implementation returns null to indicate that there is no appropriate text representation.
        Specified by:
        getAsText in interface java.beans.PropertyEditor
        Overrides:
        getAsText in class java.beans.PropertyEditorSupport