public class BodyHandlerImpl extends Object implements BodyHandler
DEFAULT_BODY_LIMIT, DEFAULT_DELETE_UPLOADED_FILES_ON_END, DEFAULT_MERGE_FORM_ATTRIBUTES, DEFAULT_PREALLOCATE_BODY_BUFFER, DEFAULT_UPLOADS_DIRECTORY| Constructor and Description |
|---|
BodyHandlerImpl() |
BodyHandlerImpl(boolean handleFileUploads) |
BodyHandlerImpl(String uploadDirectory) |
| Modifier and Type | Method and Description |
|---|---|
void |
handle(RoutingContext context)
Something has happened, so handle it.
|
BodyHandler |
setBodyLimit(long bodyLimit)
Set the maximum body size -1 means unlimited
|
BodyHandler |
setDeleteUploadedFilesOnEnd(boolean deleteUploadedFilesOnEnd)
Set whether uploaded files should be removed after handling the request
|
BodyHandler |
setHandleFileUploads(boolean handleFileUploads)
Set whether file uploads will be handled
|
BodyHandler |
setMergeFormAttributes(boolean mergeFormAttributes)
Set whether form attributes will be added to the request parameters
|
BodyHandler |
setPreallocateBodyBuffer(boolean isPreallocateBodyBuffer)
Pre-allocate the body buffer according to the value parsed from content-length header.
|
BodyHandler |
setUploadsDirectory(String uploadsDirectory)
Set the uploads directory to use
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createpublic BodyHandlerImpl()
public BodyHandlerImpl(boolean handleFileUploads)
public BodyHandlerImpl(String uploadDirectory)
public void handle(RoutingContext context)
Handlerhandle in interface Handler<RoutingContext>context - the event to handlepublic BodyHandler setHandleFileUploads(boolean handleFileUploads)
BodyHandlersetHandleFileUploads in interface BodyHandlerhandleFileUploads - true if they should be handledpublic BodyHandler setBodyLimit(long bodyLimit)
BodyHandlersetBodyLimit in interface BodyHandlerbodyLimit - the max sizepublic BodyHandler setUploadsDirectory(String uploadsDirectory)
BodyHandlersetUploadsDirectory in interface BodyHandleruploadsDirectory - the uploads directorypublic BodyHandler setMergeFormAttributes(boolean mergeFormAttributes)
BodyHandlersetMergeFormAttributes in interface BodyHandlermergeFormAttributes - true if they should be mergedpublic BodyHandler setDeleteUploadedFilesOnEnd(boolean deleteUploadedFilesOnEnd)
BodyHandlersetDeleteUploadedFilesOnEnd in interface BodyHandlerdeleteUploadedFilesOnEnd - true if uploaded files should be removed after handling the requestpublic BodyHandler setPreallocateBodyBuffer(boolean isPreallocateBodyBuffer)
BodyHandlersetPreallocateBodyBuffer in interface BodyHandlerisPreallocateBodyBuffer - 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 dynamicallyCopyright © 2020. All rights reserved.