java.lang.Object
io.helidon.http.media.ReadableEntityBase
io.helidon.webserver.http.ServerRequestEntity
- All Implemented Interfaces:
ReadableEntity
Server request entity.
-
Method Summary
Modifier and TypeMethodDescriptionCopy this entity and add a new runnable to be executed after this entity is consumed.static ServerRequestEntity
create
(Consumer<Boolean> entityRequestedCallback, UnaryOperator<InputStream> streamFilter, ContentDecoder decoder, Function<Integer, BufferData> readEntityFunction, Runnable entityProcessedRunnable, ServerRequestHeaders requestHeaders, MediaContext mediaContext) Create a new entity.protected <T> T
entityAs
(GenericType<T> type) Input stream to read bytes of the entity.Methods inherited from class io.helidon.http.media.ReadableEntityBase
as, as, asOptional, consume, consumed, empty, entityProcessedRunnable, hasEntity, readAllBytes, readEntityFunction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.http.media.ReadableEntity
as, as, asOptional, asOptional, consume, consumed, hasEntity
-
Method Details
-
create
public static ServerRequestEntity create(Consumer<Boolean> entityRequestedCallback, UnaryOperator<InputStream> streamFilter, ContentDecoder decoder, Function<Integer, BufferData> readEntityFunction, Runnable entityProcessedRunnable, ServerRequestHeaders requestHeaders, MediaContext mediaContext) Create a new entity.- Parameters:
entityRequestedCallback
- callback invoked when entity data are requested for the first timestreamFilter
- stream filter to apply, provided by userdecoder
- content decoderreadEntityFunction
- function to read buffer from entity (int is an estimated number of bytes needed, buffer will contain at least 1 byte)entityProcessedRunnable
- runnable to run once the entity is fully readrequestHeaders
- request headersmediaContext
- media context to map to correct types- Returns:
- a new entity
-
copy
Description copied from interface:ReadableEntity
Copy this entity and add a new runnable to be executed after this entity is consumed.- Specified by:
copy
in interfaceReadableEntity
- Parameters:
entityProcessedRunnable
- runnable to execute on consumed entity- Returns:
- a new entity delegating to this entity
-
inputStream
Description copied from interface:ReadableEntity
Input stream to read bytes of the entity. Cannot be combined with methodsReadableEntity.as(Class)
orReadableEntity.as(io.helidon.common.GenericType)
If there is no entity, returns input stream on empty byte array.- Specified by:
inputStream
in interfaceReadableEntity
- Overrides:
inputStream
in classReadableEntityBase
- Returns:
- input stream to entity bytes
-
entityAs
- Specified by:
entityAs
in classReadableEntityBase
-