|
Oracle Collaboration Suite Discussions Java API Reference 10g (10.1.1) Part No. B16232-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.discussions.sdk.TdAttachment
TdAttachment is a light-weight object representing an attachment in a message.
It holds metadata about an attachment. The metadata includes the attachment name and size.
Also, instead of storing the actual content of the attachment, we store an id that can be passed into TdMessage.getAttachmentById(int) to fetch the attachment.
Sample code snippet illustrating the usage of TdAttachment.
//Get the list of attachments. List lstOfAttachments = tdbi.getAttachments(); //if the list is not null, process attachments sizes. if (lstOfAttachments != null && lstOfAttachments.size() > 0) { for (int i=0;i<lstOfAttachments.size();i++) { //Extract each individual attachment. TdAttachment tda = (TdAttachment)lstOfAttachments.get(i); int iBytes += tda.getAttachmentSize(); int size = tda.getAttachmentFilename().length() + tda.getAttachmentId().length() + 4; // we add 4 for the size(int) } }
Constructor Summary | |
TdAttachment(java.lang.String path_to_attachment, java.lang.String filename, int size) Constructor to initiliaze an attachment. |
Method Summary | |
java.lang.String |
getAttachmentFilename() Returns the attachment filename associated with this attachment. |
java.lang.String |
getAttachmentId() Returns an attachment id associated with this attachment. |
int |
getAttachmentSize() Returns the attachment size associated with this attachment. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TdAttachment(java.lang.String path_to_attachment, java.lang.String filename, int size)
path_to_attachment
- the absolute path to the attachment filefilename
- the name of the attachment filesize
- size in bytes of teh attachment file.Method Detail |
public java.lang.String getAttachmentId()
This value can be passed into TdMessage.getAttachmentById to fetch the actual Part that contains the content of this attachment.
public java.lang.String getAttachmentFilename()
public int getAttachmentSize()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |