// write out the multipart (we need to use mime message trying to
// encode directly with multipart or BodyPart does not set properly
// the encodings and binary files gets ruined
MimeMessage message = new GeoServerMimeMessage();
message.setContent(multipart);
message.writeTo(output);
output.flush();
} catch (MessagingException e) {
throw new WcsException("Error occurred while encoding the mime multipart response", e);
}
}