Package io.helidon.http.media.multipart
Class MultiPartSupport
java.lang.Object
io.helidon.http.media.multipart.MultiPartSupport
- All Implemented Interfaces:
NamedService
,MediaSupport
Media support implementation for support of multipart.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.http.media.MediaSupport
MediaSupport.ReaderResponse<T>, MediaSupport.SupportLevel, MediaSupport.WriterResponse<T>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default boundary used for encoding multipart messages. -
Method Summary
Modifier and TypeMethodDescriptionstatic MediaSupport
Creates a newMultiPartSupport
.static MediaSupport
Creates a new namedMultiPartSupport
.void
init
(MediaContext context) Once all providers are discovered/configured and context is established, theMediaContext
calls this method on all providers to allow sub-resolution of readers and writers.name()
Name of this implementation, as provided inConfiguredProvider.create(Config, String)
.<T> MediaSupport.ReaderResponse
<T> reader
(GenericType<T> type, Headers requestHeaders) Reader for an entity.<T> MediaSupport.ReaderResponse
<T> reader
(GenericType<T> type, Headers requestHeaders, Headers responseHeaders) Client response reader.type()
Type of this implementation, to distinguish instances of same type, with differentNamedService.name()
.<T> MediaSupport.WriterResponse
<T> writer
(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders) Server response writer.<T> MediaSupport.WriterResponse
<T> writer
(GenericType<T> type, WritableHeaders<?> requestHeaders) Client request writer.
-
Field Details
-
DEFAULT_BOUNDARY
The default boundary used for encoding multipart messages.- See Also:
-
-
Method Details
-
create
Creates a newMultiPartSupport
.- Parameters:
config
- must not benull
- Returns:
- a new
MultiPartSupport
-
create
Creates a new namedMultiPartSupport
.- Parameters:
config
- must not benull
name
- name of the multi-part support- Returns:
- a new
MultiPartSupport
-
name
Description copied from interface:NamedService
Name of this implementation, as provided inConfiguredProvider.create(Config, String)
.- Specified by:
name
in interfaceNamedService
- Returns:
- name of this service
-
type
Description copied from interface:NamedService
Type of this implementation, to distinguish instances of same type, with differentNamedService.name()
. Use for exampleConfiguredProvider.configKey()
to define the type.- Specified by:
type
in interfaceNamedService
- Returns:
- type of this service
-
init
Description copied from interface:MediaSupport
Once all providers are discovered/configured and context is established, theMediaContext
calls this method on all providers to allow sub-resolution of readers and writers.- Specified by:
init
in interfaceMediaSupport
- Parameters:
context
- media context context
-
reader
Description copied from interface:MediaSupport
Reader for an entity.- Specified by:
reader
in interfaceMediaSupport
- Type Parameters:
T
- type- Parameters:
type
- type of entityrequestHeaders
- headers belonging to this entity (such as server request headers), expected to have content type- Returns:
- reader response, whether this type is supported or not
-
writer
public <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders) Description copied from interface:MediaSupport
Server response writer.- Specified by:
writer
in interfaceMediaSupport
- Type Parameters:
T
- type- Parameters:
type
- type of entityrequestHeaders
- request headersresponseHeaders
- response headers- Returns:
- writer response, whether this type is supported or not
-
reader
public <T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers requestHeaders, Headers responseHeaders) Description copied from interface:MediaSupport
Client response reader.- Specified by:
reader
in interfaceMediaSupport
- Type Parameters:
T
- type- Parameters:
type
- type of entityrequestHeaders
- request headersresponseHeaders
- response headers- Returns:
- reader response, whether this type is supported or not
-
writer
public <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, WritableHeaders<?> requestHeaders) Description copied from interface:MediaSupport
Client request writer.- Specified by:
writer
in interfaceMediaSupport
- Type Parameters:
T
- type- Parameters:
type
- type of entityrequestHeaders
- request headers- Returns:
- writer response, whether this type is supported or not
-