org.apache.james.mime4j.message
Class BodyCopier

java.lang.Object
  extended by org.apache.james.mime4j.message.BodyCopier

public class BodyCopier
extends java.lang.Object

Utility class for copying message bodies.


Method Summary
static Body copy(Body body)
          Returns a copy of the given Body that can be used (and modified) independently of the original.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copy

public static Body copy(Body body)
Returns a copy of the given Body that can be used (and modified) independently of the original. The copy should be disposed of when it is no longer needed.

The parent of the returned copy is null, that is, the copy is detached from the parent entity of the original.

Parameters:
body - body to copy.
Returns:
a copy of the given body.
Throws:
java.lang.UnsupportedOperationException - if body is an instance of SingleBody that does not support the copy() operation (or contains such a SingleBody).
java.lang.IllegalArgumentException - if body is null or body is a Body that is neither a Message, Multipart or SingleBody (or contains such a Body).


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.