Class BodyPartBuilder
java.lang.Object
com.linecorp.armeria.common.multipart.BodyPartBuilder
public final class BodyPartBuilder extends Object
A builder class for creating
BodyPart
instances.-
Method Summary
Modifier and Type Method Description BodyPart
build()
Returns a newly-createdBodyPart
.BodyPartBuilder
content(byte[] contents)
Adds the specifiedbytes
as a body part content.BodyPartBuilder
content(HttpData content)
Adds the specifiedHttpData
as a body part content.BodyPartBuilder
content(File file)
Adds the specifiedFile
as a body part content.BodyPartBuilder
content(File file, int bufferSize)
Adds the specifiedFile
as a body part content.BodyPartBuilder
content(CharSequence content)
Adds the specifiedCharSequence
as a UTF-8-encoded body part content.BodyPartBuilder
content(Path path)
Adds the specifiedPath
as a body part content.BodyPartBuilder
content(Path path, int bufferSize)
Adds the specifiedPath
as a body part content.BodyPartBuilder
content(org.reactivestreams.Publisher<? extends HttpData> publisher)
Adds a new body part backed by the specifiedPublisher
.BodyPartBuilder
headers(HttpHeaders headers)
Sets the specified headers for this part.
-
Method Details
-
headers
Sets the specified headers for this part.- Parameters:
headers
- headers
-
content
Adds a new body part backed by the specifiedPublisher
.- Parameters:
publisher
- publisher for the part content
-
content
Adds the specifiedCharSequence
as a UTF-8-encoded body part content. -
content
Adds the specifiedbytes
as a body part content. -
content
-
content
-
content
-
content
-
content
Adds the specifiedHttpData
as a body part content. -
build
Returns a newly-createdBodyPart
.
-