public class ContentStreamImpl extends AbstractExtensionData implements MutableContentStream
Constructor and Description |
---|
ContentStreamImpl()
Constructor.
|
ContentStreamImpl(String filename,
BigInteger length,
String mimetype,
InputStream stream)
Constructor.
|
ContentStreamImpl(String filename,
String mimetype,
String string)
Convenience constructor for tests.
|
Modifier and Type | Method and Description |
---|---|
BigInteger |
getBigLength()
Returns the length of stream.
|
String |
getFileName()
Returns the file name of the stream.
|
long |
getLength()
Returns the length of stream.
|
String |
getMimeType()
Returns the MIME type of the stream.
|
InputStream |
getStream()
Returns the stream.
|
void |
setFileName(String filename)
Sets the file name.
|
void |
setLength(BigInteger length)
Sets the length of the stream.
|
void |
setMimeType(String mimeType)
Sets the MIME type of the stream.
|
void |
setStream(InputStream stream)
Sets the stream.
|
String |
toString() |
getExtensions, setExtensions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExtensions, setExtensions
public ContentStreamImpl()
public ContentStreamImpl(String filename, BigInteger length, String mimetype, InputStream stream)
public String getFileName()
ContentStream
getFileName
in interface ContentStream
null
if the file name is
unknownpublic void setFileName(String filename)
MutableContentStream
setFileName
in interface MutableContentStream
filename
- the file namepublic long getLength()
ContentStream
getLength
in interface ContentStream
public BigInteger getBigLength()
ContentStream
getBigLength
in interface ContentStream
null
if the length
is unknownpublic void setLength(BigInteger length)
MutableContentStream
setLength
in interface MutableContentStream
length
- the length of the stream in bytes or null
if the
length is unknownpublic String getMimeType()
ContentStream
getMimeType
in interface ContentStream
null
if the MIME type is
unknownpublic void setMimeType(String mimeType)
MutableContentStream
setMimeType
in interface MutableContentStream
mimeType
- the MIME typepublic InputStream getStream()
ContentStream
It is important to close this stream properly!
getStream
in interface ContentStream
public void setStream(InputStream stream)
MutableContentStream
setStream
in interface MutableContentStream
stream
- the streampublic String toString()
toString
in class AbstractExtensionData
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.