| Modifier and Type | Method and Description |
|---|---|
MultipartBuilder |
addBinaryPart(byte[] bin,
String mimeType) |
MultipartBuilder |
addBodyPart(BodyPartBuilder bodyPart) |
MultipartBuilder |
addBodyPart(Entity bodyPart)
Adds a body part to the end of the list of body parts.
|
MultipartBuilder |
addBodyPart(Entity bodyPart,
int index)
Inserts a body part at the specified position in the list of body parts.
|
MultipartBuilder |
addContentTypeParameter(NameValuePair parameter) |
MultipartBuilder |
addTextPart(String text,
Charset charset) |
Multipart |
build() |
MultipartBuilder |
copy(Multipart other) |
static MultipartBuilder |
create() |
static MultipartBuilder |
create(String subType) |
static MultipartBuilder |
createCopy(Multipart other) |
List<Entity> |
getBodyParts()
Gets the list of body parts.
|
int |
getCount()
Returns the number of body parts.
|
String |
getEpilogue()
Returns epilogue.
|
String |
getPreamble()
Returns preamble.
|
String |
getSubType()
Gets the multipart sub-type.
|
MultipartBuilder |
removeBodyPart(int index)
Removes the body part at the specified position in the list of body
parts.
|
MultipartBuilder |
replaceBodyPart(Entity bodyPart,
int index)
Replaces the body part at the specified position in the list of body
parts with the specified body part.
|
MultipartBuilder |
setEpilogue(String epilogue)
Sets the epilogue.
|
MultipartBuilder |
setPreamble(String preamble)
Sets the preamble.
|
MultipartBuilder |
setSubType(String subType)
Sets the multipart sub-type.
|
MultipartBuilder |
use(BodyFactory bodyFactory) |
public static MultipartBuilder create(String subType)
public static MultipartBuilder createCopy(Multipart other)
public static MultipartBuilder create()
public MultipartBuilder use(BodyFactory bodyFactory)
public String getSubType()
alternative (the
default) or parallel. See RFC 2045 for common sub-types
and their meaning.public MultipartBuilder setSubType(String subType)
alternative or
parallel. See RFC 2045 for common sub-types and their
meaning.subType - the sub-type.public int getCount()
Entity objects.public List<Entity> getBodyParts()
Entity objects.public MultipartBuilder addBodyPart(Entity bodyPart)
bodyPart - the body part.public MultipartBuilder addBodyPart(BodyPartBuilder bodyPart)
public MultipartBuilder addBodyPart(Entity bodyPart, int index)
bodyPart - the body part.index - index at which the specified body part is to be inserted.public MultipartBuilder removeBodyPart(int index)
index - index of the body part to be removed.public MultipartBuilder replaceBodyPart(Entity bodyPart, int index)
bodyPart - body part to be stored at the specified position.index - index of body part to replace.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
getCount()).public String getPreamble()
public MultipartBuilder setPreamble(String preamble)
preamble - the preamble.public String getEpilogue()
public MultipartBuilder setEpilogue(String epilogue)
epilogue - the epilogue.public MultipartBuilder addContentTypeParameter(NameValuePair parameter)
public MultipartBuilder addTextPart(String text, Charset charset) throws IOException
IOExceptionpublic MultipartBuilder addBinaryPart(byte[] bin, String mimeType) throws IOException
IOExceptionpublic MultipartBuilder copy(Multipart other)
public Multipart build()
Copyright © 2004–2023 The Apache Software Foundation. All rights reserved.