MultivaluedMap<String, String> headers = new MetadataMap<String, String>();
headers.putSingle("Content-Type", "application/xml");
headers.putSingle("Content-ID", "theroot");
headers.putSingle("Content-Transfer-Encoding", "customxml");
Attachment attJaxb = new Attachment(headers, jaxb);
headers = new MetadataMap<String, String>();
headers.putSingle("Content-Type", "application/json");
headers.putSingle("Content-ID", "thejson");
headers.putSingle("Content-Transfer-Encoding", "customjson");
Attachment attJson = new Attachment(headers, json);
headers = new MetadataMap<String, String>();
headers.putSingle("Content-Type", "application/octet-stream");
headers.putSingle("Content-ID", "theimage");
headers.putSingle("Content-Transfer-Encoding", "customstream");
Attachment attIs = new Attachment(headers, is1);
objects.put(MediaType.APPLICATION_XML, attJaxb);
objects.put(MediaType.APPLICATION_JSON, attJson);
objects.put(MediaType.APPLICATION_OCTET_STREAM, attIs);