Package org.apache.james.mime4j.message
Class SingleBodyBuilder
- java.lang.Object
-
- org.apache.james.mime4j.message.SingleBodyBuilder
-
public class SingleBodyBuilder extends java.lang.Object
Builder forTextBody
andBinaryBody
instances.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
bin
private BodyFactory
bodyFactory
private java.nio.charset.Charset
charset
private java.lang.String
text
-
Constructor Summary
Constructors Constructor Description SingleBodyBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleBody
build()
BinaryBody
buildBinary()
TextBody
buildText()
SingleBodyBuilder
copy(SingleBody other)
static SingleBodyBuilder
create()
static SingleBodyBuilder
createCopy(SingleBody other)
SingleBodyBuilder
readFrom(java.io.InputStream in)
SingleBodyBuilder
readFrom(java.io.Reader in)
SingleBodyBuilder
setByteArray(byte[] bin)
SingleBodyBuilder
setCharset(java.nio.charset.Charset charset)
SingleBodyBuilder
setText(java.lang.String text)
SingleBodyBuilder
use(BodyFactory bodyFactory)
-
-
-
Field Detail
-
text
private java.lang.String text
-
bin
private byte[] bin
-
charset
private java.nio.charset.Charset charset
-
bodyFactory
private BodyFactory bodyFactory
-
-
Method Detail
-
create
public static SingleBodyBuilder create()
-
createCopy
public static SingleBodyBuilder createCopy(SingleBody other) throws java.io.IOException
- Throws:
java.io.IOException
-
use
public SingleBodyBuilder use(BodyFactory bodyFactory)
-
setText
public SingleBodyBuilder setText(java.lang.String text)
-
setByteArray
public SingleBodyBuilder setByteArray(byte[] bin)
-
setCharset
public SingleBodyBuilder setCharset(java.nio.charset.Charset charset)
-
readFrom
public SingleBodyBuilder readFrom(java.io.InputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
readFrom
public SingleBodyBuilder readFrom(java.io.Reader in) throws java.io.IOException
- Throws:
java.io.IOException
-
copy
public SingleBodyBuilder copy(SingleBody other) throws java.io.IOException
- Throws:
java.io.IOException
-
buildText
public TextBody buildText() throws java.io.IOException
- Throws:
java.io.IOException
-
buildBinary
public BinaryBody buildBinary() throws java.io.IOException
- Throws:
java.io.IOException
-
build
public SingleBody build() throws java.io.IOException
- Throws:
java.io.IOException
-
-