org.apache.james.mime4j.message
Class BodyCopier
java.lang.Object
org.apache.james.mime4j.message.BodyCopier
public class BodyCopier
- extends 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 |
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:
UnsupportedOperationException
- if body
is an instance of SingleBody
that does not support the copy()
operation (or contains such a SingleBody
).
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-2012 JBoss by Red Hat. All Rights Reserved.