if (message instanceof MimeMessageCopyOnWriteProxy) {
MimeMessageCopyOnWriteProxy messageCow = (MimeMessageCopyOnWriteProxy) message;
message = messageCow.getWrappedMessage();
}
if (message instanceof MimeMessageWrapper) {
MimeMessageWrapper wrapper = (MimeMessageWrapper) message;
if (DEEP_DEBUG) {
System.out.println("Retrieving from: " + wrapper.getSourceId());
String debugBuffer = "Saving to: " + destination + "/" + mc.getName();
System.out.println(debugBuffer);
System.out.println("Modified: " + wrapper.isModified());
}
String destinationBuffer = destination + "/" + mc.getName();
if (destinationBuffer.equals(wrapper.getSourceId())) {
if (!wrapper.isModified()) {
// We're trying to save to the same place, and it's not
// modified... we shouldn't save.
// More importantly, if we try to save, we will create a
// 0-byte file since we're
// retrying to retrieve from a file we'll be overwriting.