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.ObjectA simple class containing aURLfor anInputStream. Theurldefines thestreamslocation. 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.InputStreamgetInputStream()Gets theInputStreamthis instance holds information about.java.net.URLgetUrl()Gets an url that defines the streams location.protected voidsetInputStream(java.io.InputStream inputStream)Sets theInputStreamthis instance holds information about.protected voidsetUrl(java.net.URL url)Sets the url that defines the streams location.java.lang.StringtoString()
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream()
Gets theInputStreamthis instance holds information about.- Returns:
- the
InputStreamthis instance holds information about.
-
setInputStream
protected void setInputStream(java.io.InputStream inputStream)
Sets theInputStreamthis instance holds information about. WhileInputStreamDescriptoritself does not change itsInputStreamit does allow subclasses to change it, but still assures that theInputStreamis not null.- Parameters:
inputStream- TheInputStreamthis instance holds information about. Must not be null.
-
getUrl
public java.net.URL getUrl()
Gets an url that defines the streams location.InputStreamDescriptordoes 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. WhileInputStreamDescriptoritself does not change itsURLit does allow subclasses to change it.- Parameters:
url- The url that defines the streams location.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-