Module io.helidon.media.multipart
Package io.helidon.media.multipart
Class WriteableBodyPart.Builder
java.lang.Object
io.helidon.media.multipart.WriteableBodyPart.Builder
- All Implemented Interfaces:
Builder<WriteableBodyPart.Builder,,WriteableBodyPart> Supplier<WriteableBodyPart>
- Enclosing class:
- WriteableBodyPart
public static final class WriteableBodyPart.Builder
extends Object
implements Builder<WriteableBodyPart.Builder,WriteableBodyPart>
Builder class for creating
BodyPart instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the instance from this builder.Create a new body part backed by the specified entity.entityStream(Flow.Publisher<T> stream, Class<T> type) Create a new body part backed by the specified entity stream.Filename which will be used inContentDisposition.headers(WriteableBodyPartHeaders headers) Set the headers for this part.headers(Supplier<WriteableBodyPartHeaders> supplier) Set the headers for this part.Set the headers for this part.Name which will be used inContentDisposition.publisher(Flow.Publisher<DataChunk> publisher) Create a new body part backed by the specified publisher.
-
Method Details
-
entity
Create a new body part backed by the specified entity.- Parameters:
entity- entity for the body part content- Returns:
- this builder instance
-
entityStream
Create a new body part backed by the specified entity stream.- Type Parameters:
T- stream item type- Parameters:
stream- stream of entities for the body part contenttype- actual representation of the entity type- Returns:
- this builder instance
-
publisher
Create a new body part backed by the specified publisher.- Parameters:
publisher- publisher for the part content- Returns:
- this builder instance
-
headers
Set the headers for this part.- Parameters:
headers- headers- Returns:
- this builder instance
-
headers
Set the headers for this part.- Parameters:
supplier- headers supplier- Returns:
- this builder instance
-
headers
Set the headers for this part.- Parameters:
headers- headers map- Returns:
- this builder instance
-
name
Name which will be used inContentDisposition.
This value will be ignored if an actual instance ofWriteableBodyPartHeadersis set.- Parameters:
name- content disposition name parameter- Returns:
- this builder instance
-
filename
Filename which will be used inContentDisposition.
This value will be ignored if an actual instance ofWriteableBodyPartHeadersis set.- Parameters:
fileName- content disposition filename parameter- Returns:
- this builder instance
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<WriteableBodyPart.Builder,WriteableBodyPart> - Returns:
- instance of the built type
-