@Test public void testDecode_IgnoreExtraParts() throws Exception { FileBackedMimeEncoder mimeEncoder = new FileBackedMimeEncoder(); mimeEncoder.registerMessageFactory(new FileBackedMessageFactory()); AdaptrisMessage result = mimeEncoder.readMessage(generateOutput()); assertEquals(METADATA_VALUE, result.getMetadataValue(METADATA_KEY)); assertEquals(STANDARD_PAYLOAD, result.getContent()); }
@Override public AdaptrisMessage readMessage(File source) throws CoreException { try { AdaptrisMessage msg = currentMessageFactory().newMessage(); MultiPartFileInput input = new MultiPartFileInput(source); addPartsToMessage(input, msg); return msg; } catch (Exception e) { throw ExceptionHelper.wrapCoreException(e); } }
FileBackedMimeEncoder extends MimeEncoderImpl<File, File> { @Override public AdaptrisMessage readMessage(File source) throws CoreException { try { AdaptrisMessage msg = currentMessageFactory().newMessage(); MultiPartFileInput input = new MultiPartFileInput(source); addPartsToMessage(input, msg); return msg; } catch (Exception e) { throw ExceptionHelper.wrapCoreException(e); } } }
FileBackedMimeEncoder extends MimeEncoderImpl<File, File> { @Override public AdaptrisMessage readMessage(File source) throws CoreException { try { AdaptrisMessage msg = currentMessageFactory().newMessage(); MultiPartFileInput input = new MultiPartFileInput(source); addPartsToMessage(input, msg); return msg; } catch (Exception e) { throw ExceptionHelper.wrapCoreException(e); } } FileBackedMimeEncoder(); }
FileBackedMimeEncoder extends MimeEncoderImpl<File, File> { @Override public AdaptrisMessage readMessage(File source) throws CoreException { try { AdaptrisMessage msg = currentMessageFactory().newMessage(); MultiPartFileInput input = new MultiPartFileInput(source); addPartsToMessage(input, msg); return msg; } catch (Exception e) { throw ExceptionHelper.wrapCoreException(e); } } FileBackedMimeEncoder(); @Override void writeMessage(AdaptrisMessage msg, File target); @Override AdaptrisMessage readMessage(File source); }
FileBackedMimeEncoder extends MimeEncoderImpl<File, File> { @Override public AdaptrisMessage readMessage(File source) throws CoreException { try { AdaptrisMessage msg = currentMessageFactory().newMessage(); MultiPartFileInput input = new MultiPartFileInput(source); addPartsToMessage(input, msg); return msg; } catch (Exception e) { throw ExceptionHelper.wrapCoreException(e); } } FileBackedMimeEncoder(); @Override void writeMessage(AdaptrisMessage msg, File target); @Override AdaptrisMessage readMessage(File source);  }