org.apache.chemistry.opencmis.commons.impl.dataobjects
Class ContentStreamImpl

java.lang.Object
  extended by org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractExtensionData
      extended by org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl
All Implemented Interfaces:
java.io.Serializable, ContentStream, ExtensionsData

public class ContentStreamImpl
extends AbstractExtensionData
implements ContentStream

Content stream data implementation.

See Also:
Serialized Form

Constructor Summary
ContentStreamImpl()
          Constructor.
ContentStreamImpl(java.lang.String filename, java.math.BigInteger length, java.lang.String mimetype, java.io.InputStream stream)
          Constructor.
ContentStreamImpl(java.lang.String filename, java.lang.String mimetype, java.lang.String string)
          Convenience constructor for tests.
 
Method Summary
 java.math.BigInteger getBigLength()
          Returns the length of stream.
 java.lang.String getFileName()
          Returns the file name of the stream.
 long getLength()
          Returns the length of stream.
 java.lang.String getMimeType()
          Returns the MIME type of the stream.
 java.io.InputStream getStream()
          Returns the stream.
 void setFileName(java.lang.String filename)
           
 void setLength(java.math.BigInteger length)
           
 void setMimeType(java.lang.String mimeType)
           
 void setStream(java.io.InputStream stream)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractExtensionData
getExtensions, setExtensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.chemistry.opencmis.commons.data.ExtensionsData
getExtensions, setExtensions
 

Constructor Detail

ContentStreamImpl

public ContentStreamImpl()
Constructor.


ContentStreamImpl

public ContentStreamImpl(java.lang.String filename,
                         java.math.BigInteger length,
                         java.lang.String mimetype,
                         java.io.InputStream stream)
Constructor.


ContentStreamImpl

public ContentStreamImpl(java.lang.String filename,
                         java.lang.String mimetype,
                         java.lang.String string)
Convenience constructor for tests.

Method Detail

getFileName

public java.lang.String getFileName()
Description copied from interface: ContentStream
Returns the file name of the stream.

Specified by:
getFileName in interface ContentStream
Returns:
the file name of the stream or null if the file name is unknown

setFileName

public void setFileName(java.lang.String filename)

getLength

public long getLength()
Description copied from interface: ContentStream
Returns the length of stream.

Specified by:
getLength in interface ContentStream
Returns:
the length of the stream in bytes or -1 if the length is unknown

getBigLength

public java.math.BigInteger getBigLength()
Description copied from interface: ContentStream
Returns the length of stream.

Specified by:
getBigLength in interface ContentStream
Returns:
the length of the stream in bytes or null if the length is unknown

setLength

public void setLength(java.math.BigInteger length)

getMimeType

public java.lang.String getMimeType()
Description copied from interface: ContentStream
Returns the MIME type of the stream.

Specified by:
getMimeType in interface ContentStream
Returns:
the MIME type of the stream or null if the MIME type is unknown

setMimeType

public void setMimeType(java.lang.String mimeType)

getStream

public java.io.InputStream getStream()
Description copied from interface: ContentStream
Returns the stream. It is important to close this stream properly!

Specified by:
getStream in interface ContentStream

setStream

public void setStream(java.io.InputStream stream)

toString

public java.lang.String toString()
Overrides:
toString in class AbstractExtensionData


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.