Monday, October 7, 2002 09:57 AM
The usual questions about a "clone" operation are whether it is "deep" or "shallow", and if it is "deep", whether it is "lazy" or not...
Try it and let us know how it works out. If the clone is "shallow" and not "deep", then it might just be making a new quick copy of the top level MimeMessage object, e.g. not actually copying any of the body parts (attachments), so the cloning might be quick, and removing the large attachment part from the clone might be quick too (as long as the ref remains, to the large attachment part, in the original copy, which I assume you want to keep intact?). The danger here would be the aliasing of the 2 ref's to the body part objects, if you changed the content of one of them (in the clone) and hence changed it in the original too.
If the clone is "deep", but not "lazy", then it might take just as long, for the act of cloning to copy the large attachment part, as if you do the copy explicitly yourself (unless it can bypass the content handler somehow? maybe if the attachment part itself has a quick "clone" of its own).
Or the clone could be "deep but lazy", and not actually copy the large attachment part object if you don't open it, but to still let you remove it quickly (just the ref to it) from the cloned copy (and still only affect the clone and not the original).