Package io.vertx.mutiny.ext.web.handler
Class BodyHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.BodyHandler
- All Implemented Interfaces:
MutinyDelegate
,io.vertx.core.Handler<RoutingContext>
,Consumer<RoutingContext>
public class BodyHandler
extends Object
implements MutinyDelegate, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
A handler which gathers the entire request body and sets it on the .
It also handles HTTP file uploads and can be used to limit body sizes.
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<BodyHandler>
static final long
Default max size for a request body in bytes =10485760
, i.e. 10 megabytesstatic final boolean
Default value of whether uploaded files should be removed after handling the requeststatic final boolean
Default value of whether form attributes should be merged into request paramsstatic final boolean
Default value of whether to pre-allocate the body buffer size according to the content-length HTTP request headerstatic final String
Default uploads directory on server for file uploads -
Constructor Summary
ConstructorsConstructorDescriptionBodyHandler
(io.vertx.ext.web.handler.BodyHandler delegate) BodyHandler
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(RoutingContext item) static BodyHandler
create()
static BodyHandler
create
(boolean handleFileUploads) static BodyHandler
boolean
io.vertx.ext.web.handler.BodyHandler
void
handle
(RoutingContext arg0) int
hashCode()
static BodyHandler
newInstance
(io.vertx.ext.web.handler.BodyHandler arg) setBodyLimit
(long bodyLimit) setDeleteUploadedFilesOnEnd
(boolean deleteUploadedFilesOnEnd) setHandleFileUploads
(boolean handleFileUploads) setMergeFormAttributes
(boolean mergeFormAttributes) setPreallocateBodyBuffer
(boolean isPreallocateBodyBuffer) setUploadsDirectory
(String uploadsDirectory) toString()
-
Field Details
-
__TYPE_ARG
-
DEFAULT_BODY_LIMIT
public static final long DEFAULT_BODY_LIMITDefault max size for a request body in bytes =10485760
, i.e. 10 megabytes- See Also:
-
DEFAULT_UPLOADS_DIRECTORY
Default uploads directory on server for file uploads- See Also:
-
DEFAULT_MERGE_FORM_ATTRIBUTES
public static final boolean DEFAULT_MERGE_FORM_ATTRIBUTESDefault value of whether form attributes should be merged into request params- See Also:
-
DEFAULT_DELETE_UPLOADED_FILES_ON_END
public static final boolean DEFAULT_DELETE_UPLOADED_FILES_ON_ENDDefault value of whether uploaded files should be removed after handling the request- See Also:
-
DEFAULT_PREALLOCATE_BODY_BUFFER
public static final boolean DEFAULT_PREALLOCATE_BODY_BUFFERDefault value of whether to pre-allocate the body buffer size according to the content-length HTTP request header- See Also:
-
-
Constructor Details
-
BodyHandler
public BodyHandler(io.vertx.ext.web.handler.BodyHandler delegate) -
BodyHandler
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.handler.BodyHandler getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
-
create
- Returns:
- the body handler
-
create
- Parameters:
handleFileUploads
- true if files upload should be handled- Returns:
- the body handler
-
create
- Parameters:
uploadDirectory
- the uploads directory- Returns:
- the body handler
-
setHandleFileUploads
- Parameters:
handleFileUploads
- true if they should be handled- Returns:
- reference to this for fluency
-
setBodyLimit
- Parameters:
bodyLimit
- the max size in bytes- Returns:
- reference to this for fluency
-
setUploadsDirectory
- Parameters:
uploadsDirectory
- the uploads directory- Returns:
- reference to this for fluency
-
setMergeFormAttributes
- Parameters:
mergeFormAttributes
- true if they should be merged- Returns:
- reference to this for fluency
-
setDeleteUploadedFilesOnEnd
- Parameters:
deleteUploadedFilesOnEnd
- true if uploaded files should be removed after handling the request- Returns:
- reference to this for fluency
-
setPreallocateBodyBuffer
- Parameters:
isPreallocateBodyBuffer
-true
if body buffer is pre-allocated according to the size read from content-length Header. {code false} if body buffer is pre-allocated to 1KB, and is resized dynamically- Returns:
- reference to this for fluency
-
accept
- Specified by:
accept
in interfaceConsumer<RoutingContext>
-
newInstance
-