Package com.saperion.common.io
Class InputStreamDescriptor
- java.lang.Object
-
- com.saperion.common.io.InputStreamDescriptor
-
- Direct Known Subclasses:
ContentStream
public class InputStreamDescriptor extends java.lang.Object
A simple class containing aURL
for anInputStream
. Theurl
defines thestreams
location
. While the stream itself must be given (must not be null) the url may be omitted.- Author:
- agz, jsc
-
-
Constructor Summary
Constructors Constructor Description InputStreamDescriptor(java.io.InputStream inputStream)
InputStreamDescriptor(java.io.InputStream inputStream, java.net.URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
getInputStream()
Gets theInputStream
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 theInputStream
this instance holds information about.protected void
setUrl(java.net.URL url)
Sets the url that defines the streams location.java.lang.String
toString()
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream()
Gets theInputStream
this instance holds information about.- Returns:
- the
InputStream
this instance holds information about.
-
setInputStream
protected void setInputStream(java.io.InputStream inputStream)
Sets theInputStream
this instance holds information about. WhileInputStreamDescriptor
itself does not change itsInputStream
it does allow subclasses to change it, but still assures that theInputStream
is not null.- Parameters:
inputStream
- TheInputStream
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. WhileInputStreamDescriptor
itself does not change itsURL
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 classjava.lang.Object
-
-