protected void saveAttachment(File attachmentsStore, Object attachment) throws Exception
{
if(log.isTraceEnabled())
log.trace("saveAttachment, attachmentsStore="+attachmentsStore+ ", attachment="+attachment);
JAXBContext ctx = JAXBContext.newInstance(attachment.getClass());
Marshaller marshaller = ctx.createMarshaller();
marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE);
OutputStream os = new FileOutputStream(attachmentsStore);
try
{
marshaller.marshal(attachment, os);