Nitido Inc.

com.nitido.nim
Class NotificationBodyPart

java.lang.Object
  extended by javax.mail.BodyPart
      extended by javax.mail.internet.MimeBodyPart
          extended by com.nitido.nim.NotificationBodyPart
All Implemented Interfaces:
javax.mail.internet.MimePart, javax.mail.Part

public class NotificationBodyPart
extends javax.mail.internet.MimeBodyPart

This is a specialized extension of the standard MimeBodyPart object that can remember the full ContentType string. The standard MimeBodyPart object only remembers the MIME portion of the ContentType string. As a result, it will lost all the information regarding the encoding and charset.

This object should be used instead of MimeBodyPart when constructing the NotificationMessage.

This object is not thread safe. The developer must make sure this object is not shared across multiple threads.

(All of its member variables are not declared as volatile. If you really need to use it across mutiple threads, you must synchronized on this object instance itself. Otherwise, it may not work properly on multi-core systems.)


Field Summary
 
Fields inherited from class javax.mail.internet.MimeBodyPart
content, contentStream, dh, headers
 
Fields inherited from class javax.mail.BodyPart
parent
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
NotificationBodyPart()
           
 
Method Summary
 java.lang.String getContentType()
          This method override the MimeBodyPart's implementation by returning the full content type it may have remembered from previous setContent calls.
 void setContent(java.lang.Object o, java.lang.String type)
          This method override the MimeBodyPart's implementation by remembering the full content type string without any truncation.
 
Methods inherited from class javax.mail.internet.MimeBodyPart
addHeader, addHeaderLine, attachFile, attachFile, getAllHeaderLines, getAllHeaders, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getSize, isMimeType, removeHeader, saveFile, saveFile, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setHeader, setText, setText, setText, updateHeaders, writeTo
 
Methods inherited from class javax.mail.BodyPart
getParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationBodyPart

public NotificationBodyPart()
Method Detail

setContent

public void setContent(java.lang.Object o,
                       java.lang.String type)
                throws javax.mail.MessagingException
This method override the MimeBodyPart's implementation by remembering the full content type string without any truncation. It will then forward the call to the MimeBodyPart's implementation.

Specified by:
setContent in interface javax.mail.Part
Overrides:
setContent in class javax.mail.internet.MimeBodyPart
Throws:
javax.mail.MessagingException

getContentType

public java.lang.String getContentType()
                                throws javax.mail.MessagingException
This method override the MimeBodyPart's implementation by returning the full content type it may have remembered from previous setContent calls. If the "remembered full content type" string is null, it will forward the call back to the MimeBodyPart's implementation. (It will take care of the default content type detection and assingment.)

Specified by:
getContentType in interface javax.mail.Part
Overrides:
getContentType in class javax.mail.internet.MimeBodyPart
Throws:
javax.mail.MessagingException

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.