use of javax.mail.internet.ParameterList in project rest.li by linkedin.
the class MIMETestUtils method createBodyLessBody.
private static final MimeBodyPart createBodyLessBody() {
try {
//Body-less body. This has no body but does have headers, some of which are folded.
final MimeBodyPart dataPart = new MimeBodyPart();
final ParameterList parameterList = new ParameterList();
parameterList.set("AVeryVeryVeryVeryLongHeader", "AVeryVeryVeryVeryLongValue");
parameterList.set("AVeryVeryVeryVeryLongHeader2", "AVeryVeryVeryVeryLongValue2");
parameterList.set("AVeryVeryVeryVeryLongHeader3", "AVeryVeryVeryVeryLongValue3");
parameterList.set("AVeryVeryVeryVeryLongHeader4", "AVeryVeryVeryVeryLongValue4");
final ContentType contentType = new ContentType("text", "plain", parameterList);
dataPart.setContent("", contentType.getBaseType());
dataPart.setHeader(HEADER_CONTENT_TYPE, contentType.toString());
dataPart.setHeader("YetAnotherCustomHeader", "YetAnotherCustomValue");
return dataPart;
} catch (Exception exception) {
Assert.fail();
}
return null;
}
Aggregations