@Test public void testCopyPayload_BothFileBacked() throws Exception { AdaptrisMessage reply = new FileBackedMessageFactory().newMessage("hello world"); AdaptrisMessage original = new FileBackedMessageFactory().newMessage(); MessageHelper.copyPayload(reply, original); assertEquals("hello world", original.getContent()); assertTrue(original.getObjectHeaders().containsKey(reply.getUniqueId())); }
public static void copyPayload(AdaptrisMessage src, AdaptrisMessage dest) throws IOException { if (BooleanUtils .and(new boolean[] {src instanceof FileBackedMessage, dest instanceof FileBackedMessage})) { ((FileBackedMessage) dest).initialiseFrom(((FileBackedMessage) src).currentSource()); ((FileBackedMessage) dest).addObjectHeader(src.getUniqueId(), src); } else { copyPayloadStream(src, dest); } }
MessageHelper { public static void copyPayload(AdaptrisMessage src, AdaptrisMessage dest) throws IOException { if (BooleanUtils .and(new boolean[] {src instanceof FileBackedMessage, dest instanceof FileBackedMessage})) { ((FileBackedMessage) dest).initialiseFrom(((FileBackedMessage) src).currentSource()); ((FileBackedMessage) dest).addObjectHeader(src.getUniqueId(), src); } else { copyPayloadStream(src, dest); } } }
MessageHelper { public static void copyPayload(AdaptrisMessage src, AdaptrisMessage dest) throws IOException { if (BooleanUtils .and(new boolean[] {src instanceof FileBackedMessage, dest instanceof FileBackedMessage})) { ((FileBackedMessage) dest).initialiseFrom(((FileBackedMessage) src).currentSource()); ((FileBackedMessage) dest).addObjectHeader(src.getUniqueId(), src); } else { copyPayloadStream(src, dest); } }  }
MessageHelper { public static void copyPayload(AdaptrisMessage src, AdaptrisMessage dest) throws IOException { if (BooleanUtils .and(new boolean[] {src instanceof FileBackedMessage, dest instanceof FileBackedMessage})) { ((FileBackedMessage) dest).initialiseFrom(((FileBackedMessage) src).currentSource()); ((FileBackedMessage) dest).addObjectHeader(src.getUniqueId(), src); } else { copyPayloadStream(src, dest); } }  static void copyPayload(AdaptrisMessage src, AdaptrisMessage dest); static void copyPayloadStream(AdaptrisMessage src, AdaptrisMessage dest); static AdaptrisMessage checkCharsetAndApply(final AdaptrisMessage msg, String charEnc,
      final boolean passthru); }
MessageHelper { public static void copyPayload(AdaptrisMessage src, AdaptrisMessage dest) throws IOException { if (BooleanUtils .and(new boolean[] {src instanceof FileBackedMessage, dest instanceof FileBackedMessage})) { ((FileBackedMessage) dest).initialiseFrom(((FileBackedMessage) src).currentSource()); ((FileBackedMessage) dest).addObjectHeader(src.getUniqueId(), src); } else { copyPayloadStream(src, dest); } }  static void copyPayload(AdaptrisMessage src, AdaptrisMessage dest); static void copyPayloadStream(AdaptrisMessage src, AdaptrisMessage dest); static AdaptrisMessage checkCharsetAndApply(final AdaptrisMessage msg, String charEnc,
      final boolean passthru);  }