private void getContent ( Query query , Message message , int row ) throws MessagingException , IOException { StringBuffer body = new StringBuffer ( ) ; Struct cids = new StructImpl ( ) ; query . setAtEL ( CIDS , row , cids ) ; if ( message . isMimeType ( "text/plain" ) ) { String content = getConent ( message ) ; query . setAtEL ( TEXT_BODY , row , content ) ; body . append ( content ) ; } else if ( message . isMimeType ( "text/html" ) ) { String content = getConent ( message ) ; query . setAtEL ( HTML_BODY , row , content ) ; body . append ( content ) ; } else { Object content = message . getContent ( ) ; if ( content instanceof MimeMultipart ) { Array attachments = new ArrayImpl ( ) ; Array attachmentFiles = new ArrayImpl ( ) ; getMultiPart ( query , row , attachments , attachmentFiles , cids , ( MimeMultipart ) content , body ) ; if ( attachments . size ( ) > 0 ) { try { query . setAtEL ( ATTACHMENTS , row , ListUtil . arrayToList ( attachments , "\t" ) ) ; } catch ( PageException pageexception ) { } } if ( attachmentFiles . size ( ) > 0 ) { try { query . setAtEL ( ATTACHMENT_FILES , row , ListUtil . arrayToList ( attachmentFiles , "\t" ) ) ; } catch ( PageException pageexception1 ) { } } } } query . setAtEL ( BODY , row , body . toString ( ) ) ; }
write content data to query