Class InputStreamDescriptor

java.lang.Object
com.saperion.common.io.InputStreamDescriptor
Direct Known Subclasses:
ContentStream

public class InputStreamDescriptor extends Object
A simple class containing aURL for an InputStream. The url defines the streams location. While the stream itself must be given (must not be null) the url may be omitted.
Author:
agz, jsc
  • Constructor Details

    • InputStreamDescriptor

      public InputStreamDescriptor(InputStream inputStream, URL url)
    • InputStreamDescriptor

      public InputStreamDescriptor(InputStream inputStream)
  • Method Details

    • getInputStream

      public InputStream getInputStream()
      Gets the InputStream this instance holds information about.
      Returns:
      the InputStream this instance holds information about.
    • setInputStream

      protected void setInputStream(InputStream inputStream)
      Sets the InputStream this instance holds information about. While InputStreamDescriptor itself does not change its InputStream it does allow subclasses to change it, but still assures that the InputStream is not null.
      Parameters:
      inputStream - The InputStream this instance holds information about. Must not be null.
    • getUrl

      public URL getUrl()
      Gets an url that defines the streams location. InputStreamDescriptor does not guarantee that a call to getUrl().openStream() returns a stream to the same binary data. It does not guarantee nor require that the url is not ambiguous e.g. a "file://"- url for a remote stream.
      Returns:
      an url that defines the streams location.
    • setUrl

      protected void setUrl(URL url)
      Sets the url that defines the streams location. While InputStreamDescriptor itself does not change its URL it does allow subclasses to change it.
      Parameters:
      url - The url that defines the streams location.
    • toString

      public String toString()
      Overrides:
      toString in class Object