I'm writing a smtpWriter and I want to put the content of a flat file in the smtpMessage whith this pipeline stage config:
entryStage=entry
entry.stageType=Null
entry.nextStage=enviamail
entry.tracked=true
enviamail.stageType=SmtpWriter
enviamail.smtpHost=localhost
enviamail.smtpFrom=santi@standalonesystems.com
enviamail.smtpSubject=New was received (${document.getName()})
enviamail.documentFileName=sms-received.txt
enviamail.smtpTo=al-sms@standalonesystems.com
enviamail.smtpMessage=${document.toString()}
enviamail.tracked=true
enviamail.nextStage=null
but in the message it put all this:
com.babeldoc.core.pipeline.PipelineDocument@160a26f[attributes={mimeType=application/octet-stream, scan_path=/var/spool/sms/incoming/GSM1wJ0oY5, binary=true, file_name=GSM1wJ0oY5, scan_date=1076849733000, done_dir=/var/spool/sms/entregats/, scanner=sms},buffer={70,114,111,109,58,32,56,48,54,48,48,10,70,114,111,109,95,83,77,83,67,58,32,51,52,54,53,54,48,48,48,51,49,49,10,83,101,110,116,58,32,48,52,45,48,50,45,49,53,32,49,51,58,52,55,58,50,53,10,82,101,99,101,105,118,101,100,58,32,48,52,45,48,50,45,49,53,32,49,51,58,53,53,58,51,51,10,83,117,98,106,101,99,116,58,32,71,83,77,49,10,10,65,109,101,110,97,32,105,110,102,111,114,109,97,58,32,83,105,32,114,101,97,108,105,122,97,115,32,117,110,97,32,117,110,105,99,97,32,114,101,99,97,114,103,97,32,100,101,32,50,48,101,117,32,101,110,32,101,115,116,101,32,109,111,118,105,108,44,100,101,115,100,101,32,101,108,32,55,32,121,32,101,108,32,50,50,32,100,101,32,70,101,98,114,101,114,111,44,114,101,99,105,98,101,115,32,51,48,109,105,110,32,103,114,97,116,105,115,32,97,110,116,101,115,32,100,101,108,32,53,47,51,40,112,97,114,97,32,65,109,101,110,97,43,102,105,106,111,115,32,110,97,99,105,111,110,97,108,101,115,41,10}] ${(document.getBytes()).toString()}
How can I write only the buffer data like a string?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I try to do that ( with $document.bytes, $document.getBytes(),...) the result it's a [B@12be1bd that seems a pointer or something similar.
As sugested by mitchellch in bug number 866167 I've modified the PipelineDocument.java code and all works fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm writing a smtpWriter and I want to put the content of a flat file in the smtpMessage whith this pipeline stage config:
entryStage=entry
entry.stageType=Null
entry.nextStage=enviamail
entry.tracked=true
enviamail.stageType=SmtpWriter
enviamail.smtpHost=localhost
enviamail.smtpFrom=santi@standalonesystems.com
enviamail.smtpSubject=New was received (${document.getName()})
enviamail.documentFileName=sms-received.txt
enviamail.smtpTo=al-sms@standalonesystems.com
enviamail.smtpMessage=${document.toString()}
enviamail.tracked=true
enviamail.nextStage=null
but in the message it put all this:
com.babeldoc.core.pipeline.PipelineDocument@160a26f[attributes={mimeType=application/octet-stream, scan_path=/var/spool/sms/incoming/GSM1wJ0oY5, binary=true, file_name=GSM1wJ0oY5, scan_date=1076849733000, done_dir=/var/spool/sms/entregats/, scanner=sms},buffer={70,114,111,109,58,32,56,48,54,48,48,10,70,114,111,109,95,83,77,83,67,58,32,51,52,54,53,54,48,48,48,51,49,49,10,83,101,110,116,58,32,48,52,45,48,50,45,49,53,32,49,51,58,52,55,58,50,53,10,82,101,99,101,105,118,101,100,58,32,48,52,45,48,50,45,49,53,32,49,51,58,53,53,58,51,51,10,83,117,98,106,101,99,116,58,32,71,83,77,49,10,10,65,109,101,110,97,32,105,110,102,111,114,109,97,58,32,83,105,32,114,101,97,108,105,122,97,115,32,117,110,97,32,117,110,105,99,97,32,114,101,99,97,114,103,97,32,100,101,32,50,48,101,117,32,101,110,32,101,115,116,101,32,109,111,118,105,108,44,100,101,115,100,101,32,101,108,32,55,32,121,32,101,108,32,50,50,32,100,101,32,70,101,98,114,101,114,111,44,114,101,99,105,98,101,115,32,51,48,109,105,110,32,103,114,97,116,105,115,32,97,110,116,101,115,32,100,101,108,32,53,47,51,40,112,97,114,97,32,65,109,101,110,97,43,102,105,106,111,115,32,110,97,99,105,111,110,97,108,101,115,41,10}] ${(document.getBytes()).toString()}
How can I write only the buffer data like a string?
Tyr getting the buffer
$document.bytes
If I try to do that ( with $document.bytes, $document.getBytes(),...) the result it's a [B@12be1bd that seems a pointer or something similar.
As sugested by mitchellch in bug number 866167 I've modified the PipelineDocument.java code and all works fine.