Class InputStreamDescriptor

  • Direct Known Subclasses:
    ContentStream

    public class InputStreamDescriptor
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.InputStream getInputStream()
      Gets the InputStream this instance holds information about.
      java.net.URL getUrl()
      Gets an url that defines the streams location.
      protected void setInputStream​(java.io.InputStream inputStream)
      Sets the InputStream this instance holds information about.
      protected void setUrl​(java.net.URL url)
      Sets the url that defines the streams location.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • InputStreamDescriptor

        public InputStreamDescriptor​(java.io.InputStream inputStream,
                                     java.net.URL url)
      • InputStreamDescriptor

        public InputStreamDescriptor​(java.io.InputStream inputStream)
    • Method Detail

      • getInputStream

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

        protected void setInputStream​(java.io.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 java.net.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​(java.net.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object