com.ados.hestia.parser.rnbm.exchange
Class Attachment

java.lang.Object
  extended by com.ados.hestia.parser.rnbm.exchange.Attachment
All Implemented Interfaces:
Serializable

public class Attachment
extends Object
implements Serializable

This stores attachment of RNBM. Can be created from file. See Utils.getAttachment.

Version:
$Revision: 1290 $
See Also:
Serialized Form

Field Summary
protected  String m_contentID
           
protected  String m_contentType
           
protected  String m_description
           
protected  String m_name
           
protected  IStore m_store
           
 
Constructor Summary
Attachment()
           
Attachment(String name, String contentType, InputStream istr)
          Construct attachment by reading content from provided stream.
Attachment(String name, String contentType, IStore store)
          Construct attachment directly from store.
 
Method Summary
 String getContentID()
          Returns unique id of attachment.
 String getContentType()
          Returns content type of attachment.
 String getDescription()
          Returns attachment description or null if not present.
 String getName()
          Returns name, associated with attachment.
 long getSize()
          Returns size of content of attachment.
 IStore getStore()
          Returns associated store.
 InputStream openSharedStream()
           
 InputStream openStream()
          Returns stream with content of attachment.
 void setContentID(String contentID)
          Set attachment id.
 void setStore(IStore store)
          Set base store.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_name

protected String m_name

m_contentType

protected String m_contentType

m_description

protected String m_description

m_contentID

protected String m_contentID

m_store

protected IStore m_store
Constructor Detail

Attachment

public Attachment()

Attachment

public Attachment(String name,
                  String contentType,
                  InputStream istr)
           throws IOException
Construct attachment by reading content from provided stream. Stream will be closed after reading.

Parameters:
name - name of stream
contentType - content type of stream. Can be null for automatically detect
istr - stream to read content. Will be closed after reading
Throws:
IOException

Attachment

public Attachment(String name,
                  String contentType,
                  IStore store)
Construct attachment directly from store.

Parameters:
name - name of attachment
contentType - content type of attachment. Can be null
store - direct content of attachment
Method Detail

setContentID

public void setContentID(String contentID)
Set attachment id.

Parameters:
contentID - id to set

getContentID

public String getContentID()
Returns unique id of attachment. If this was not set then generate new.

Returns:
unique id of attachment. If this was not set then generate new

getName

public String getName()
Returns name, associated with attachment.

Returns:
name, associated with attachment

getContentType

public String getContentType()
Returns content type of attachment.

Returns:
content type of attachment

getSize

public long getSize()
Returns size of content of attachment.

Returns:
size of content of attachment

openStream

public InputStream openStream()
                       throws IOException
Returns stream with content of attachment.

Returns:
stream with content of attachment
Throws:
IOException

openSharedStream

public InputStream openSharedStream()
                             throws IOException
Throws:
IOException

getDescription

public String getDescription()
Returns attachment description or null if not present.

Returns:
attachment description or null if not present

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getStore

public IStore getStore()
Returns associated store.

Returns:
associated store

setStore

public void setStore(IStore store)
Set base store.



Copyright © 2005-2006 ADOS Co.,Ltd.. All Rights Reserved.