/** * Initializes the {@link DataHandler} associated with the body part * when it contains media content. */ private void initMediaDataHandler() throws MessagingException { // Cannot call setDataHandler() because it invalidates header data // Fortunately, 'dh' is a protected field on the base class. if (!isAtomPart()) { // For media content, simply wrap the media source. dh = new MediaSourceDataHandler(mediaSource); } else { // For Atom content, use standard Java activation handling. dh = new DataHandler(mediaSource); } }
/** * Initializes the {@link DataHandler} associated with the body part * when it contains media content. */ private void initMediaDataHandler() throws MessagingException { // Cannot call setDataHandler() because it invalidates header data // Fortunately, 'dh' is a protected field on the base class. if (!isAtomPart()) { // For media content, simply wrap the media source. dh = new MediaSourceDataHandler(mediaSource); } else { // For Atom content, use standard Java activation handling. dh = new DataHandler(mediaSource); } }