Package io.vertx.mutiny.ext.web.handler
Class BodyHandler
- java.lang.Object
 - 
- io.vertx.mutiny.ext.web.handler.BodyHandler
 
 
- 
- All Implemented Interfaces:
 io.vertx.core.Handler<RoutingContext>,Consumer<RoutingContext>
public class BodyHandler extends Object implements 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 theoriginalnon Mutiny-ified interface using Vert.x codegen. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static TypeArg<BodyHandler>__TYPE_ARGstatic longDEFAULT_BODY_LIMITDefault max size for a request body =-1means unlimitedstatic booleanDEFAULT_DELETE_UPLOADED_FILES_ON_ENDDefault value of whether uploaded files should be removed after handling the requeststatic booleanDEFAULT_MERGE_FORM_ATTRIBUTESDefault value of whether form attributes should be merged into request paramsstatic booleanDEFAULT_PREALLOCATE_BODY_BUFFERDefault value of whether to pre-allocate the body buffer size according to the content-length HTTP request headerstatic StringDEFAULT_UPLOADS_DIRECTORYDefault uploads directory on server for file uploads 
- 
Constructor Summary
Constructors Constructor Description BodyHandler(io.vertx.ext.web.handler.BodyHandler delegate)BodyHandler(Object delegate) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(RoutingContext item)static BodyHandlercreate()static BodyHandlercreate(boolean handleFileUploads)static BodyHandlercreate(String uploadDirectory)booleanequals(Object o)io.vertx.ext.web.handler.BodyHandlergetDelegate()voidhandle(RoutingContext arg0)inthashCode()static BodyHandlernewInstance(io.vertx.ext.web.handler.BodyHandler arg)BodyHandlersetBodyLimit(long bodyLimit)BodyHandlersetDeleteUploadedFilesOnEnd(boolean deleteUploadedFilesOnEnd)BodyHandlersetHandleFileUploads(boolean handleFileUploads)BodyHandlersetMergeFormAttributes(boolean mergeFormAttributes)BodyHandlersetPreallocateBodyBuffer(boolean isPreallocateBodyBuffer)BodyHandlersetUploadsDirectory(String uploadsDirectory)StringtoString() 
 - 
 
- 
- 
Field Detail
- 
__TYPE_ARG
public static final TypeArg<BodyHandler> __TYPE_ARG
 
- 
DEFAULT_BODY_LIMIT
public static final long DEFAULT_BODY_LIMIT
Default max size for a request body =-1means unlimited- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_UPLOADS_DIRECTORY
public static final String DEFAULT_UPLOADS_DIRECTORY
Default uploads directory on server for file uploads- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_MERGE_FORM_ATTRIBUTES
public static final boolean DEFAULT_MERGE_FORM_ATTRIBUTES
Default value of whether form attributes should be merged into request params- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_DELETE_UPLOADED_FILES_ON_END
public static final boolean DEFAULT_DELETE_UPLOADED_FILES_ON_END
Default value of whether uploaded files should be removed after handling the request- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_PREALLOCATE_BODY_BUFFER
public static final boolean DEFAULT_PREALLOCATE_BODY_BUFFER
Default value of whether to pre-allocate the body buffer size according to the content-length HTTP request header- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
BodyHandler
public BodyHandler(io.vertx.ext.web.handler.BodyHandler delegate)
 
- 
BodyHandler
public BodyHandler(Object delegate)
 
 - 
 
- 
Method Detail
- 
getDelegate
public io.vertx.ext.web.handler.BodyHandler getDelegate()
 
- 
handle
public void handle(RoutingContext arg0)
- Specified by:
 handlein interfaceio.vertx.core.Handler<RoutingContext>
 
- 
create
public static BodyHandler create()
- Returns:
 - the body handler
 
 
- 
create
public static BodyHandler create(boolean handleFileUploads)
- Parameters:
 handleFileUploads- true if files upload should be handled- Returns:
 - the body handler
 
 
- 
create
public static BodyHandler create(String uploadDirectory)
- Parameters:
 uploadDirectory- the uploads directory- Returns:
 - the body handler
 
 
- 
setHandleFileUploads
public BodyHandler setHandleFileUploads(boolean handleFileUploads)
- Parameters:
 handleFileUploads- true if they should be handled- Returns:
 - reference to this for fluency
 
 
- 
setBodyLimit
public BodyHandler setBodyLimit(long bodyLimit)
- Parameters:
 bodyLimit- the max size in bytes- Returns:
 - reference to this for fluency
 
 
- 
setUploadsDirectory
public BodyHandler setUploadsDirectory(String uploadsDirectory)
- Parameters:
 uploadsDirectory- the uploads directory- Returns:
 - reference to this for fluency
 
 
- 
setMergeFormAttributes
public BodyHandler setMergeFormAttributes(boolean mergeFormAttributes)
- Parameters:
 mergeFormAttributes- true if they should be merged- Returns:
 - reference to this for fluency
 
 
- 
setDeleteUploadedFilesOnEnd
public BodyHandler setDeleteUploadedFilesOnEnd(boolean deleteUploadedFilesOnEnd)
- Parameters:
 deleteUploadedFilesOnEnd- true if uploaded files should be removed after handling the request- Returns:
 - reference to this for fluency
 
 
- 
setPreallocateBodyBuffer
public BodyHandler setPreallocateBodyBuffer(boolean isPreallocateBodyBuffer)
- Parameters:
 isPreallocateBodyBuffer-trueif 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
public void accept(RoutingContext item)
- Specified by:
 acceptin interfaceConsumer<RoutingContext>
 
- 
newInstance
public static BodyHandler newInstance(io.vertx.ext.web.handler.BodyHandler arg)
 
 - 
 
 -