/** * Creates an input stream to read the file content from. */ @Override protected InputStream doGetInputStream() throws Exception { if (isMultipart()) { // deliver the preamble as the only content final String preamble = ((MimeMultipart) part.getContent()).getPreamble(); if (preamble == null) { return new ByteArrayInputStream(new byte[] {}); } return new ByteArrayInputStream(preamble.getBytes(MimeFileSystem.PREAMBLE_CHARSET)); } return part.getInputStream(); }
/** * Creates an input stream to read the file content from. */ @Override protected InputStream doGetInputStream() throws Exception { if (isMultipart()) { // deliver the preamble as the only content String preamble = ((MimeMultipart) part.getContent()).getPreamble(); if (preamble == null) { return new ByteArrayInputStream(new byte[]{}); } return new ByteArrayInputStream(preamble.getBytes(MimeFileSystem.PREAMBLE_CHARSET)); } return part.getInputStream(); }
private void appendMultiPart(SampleResult child, StringBuilder cdata, MimeMultipart mmp) throws MessagingException, IOException { String preamble = mmp.getPreamble(); if (preamble != null ){ cdata.append(preamble);