Search in sources :

Example 66 with MetadataCollection

use of com.adaptris.core.MetadataCollection in project interlok by adaptris.

the class MimeAggregator method createInitialPart.

protected MultiPartOutput createInitialPart(AdaptrisMessage original) throws MessagingException, IOException {
    MultiPartOutput output = new MultiPartOutput(original.getUniqueId(), mimeContentSubType(original));
    MetadataCollection metadata = mimeHeaderFilter().filter(original);
    metadata.forEach((e) -> {
        output.setHeader(e.getKey(), e.getValue());
    });
    output.addPart(createBodyPart(original), contentId(original));
    return output;
}
Also used : MultiPartOutput(com.adaptris.util.text.mime.MultiPartOutput) MetadataCollection(com.adaptris.core.MetadataCollection)

Aggregations

MetadataCollection (com.adaptris.core.MetadataCollection)66 Test (org.junit.Test)43 MetadataElement (com.adaptris.core.MetadataElement)18 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)12 KeyValuePair (com.adaptris.util.KeyValuePair)4 Message (javax.jms.Message)4 Session (javax.jms.Session)4 MultiPartOutput (com.adaptris.util.text.mime.MultiPartOutput)3 InternetHeaders (javax.mail.internet.InternetHeaders)2 MimeBodyPart (javax.mail.internet.MimeBodyPart)2 Event (com.adaptris.core.Event)1 AdapterCloseEvent (com.adaptris.core.event.AdapterCloseEvent)1 MetadataFilterImpl (com.adaptris.core.metadata.MetadataFilterImpl)1 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 Properties (java.util.Properties)1 JMSException (javax.jms.JMSException)1