Class FormFactory
java.lang.Object
io.micronaut.http.server.multipart.FormFactory
Global utility class for form data access.
- Since:
- 5.0.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptioncompleteAttribute(FormCapableHttpRequest<?> request, RawFormField formField) Asynchronously buffer the given attribute.completeFileUpload(FormCapableHttpRequest<?> request, RawFormField formField) Buffer a streamedRawFormFieldinto aCompletedFileUpload.ExecutionFlow<? extends CompletedPart> completePart(FormCapableHttpRequest<?> request, RawFormField formField) Asynchronously buffer the given field.static @Nullable FormRouteCompletergetCompleterOrNull(HttpRequest<?> request) Get the completer for the given request, if it has been created bygetOrCreateCompleter(HttpRequest).getOrCreateCompleter(HttpRequest<?> request) Create the completer for the given request if necessary.streamFileUpload(RawFormField formField) Create a newStreamingFileUploadfrom the given raw data.
-
Method Details
-
getDiskWriteExecutor
-
getCompleterOrNull
Get the completer for the given request, if it has been created bygetOrCreateCompleter(HttpRequest).- Parameters:
request- The request- Returns:
- The completer
-
getOrCreateCompleter
Create the completer for the given request if necessary.- Parameters:
request- The request- Returns:
- The completer
-
completePart
public ExecutionFlow<? extends CompletedPart> completePart(FormCapableHttpRequest<?> request, RawFormField formField) Asynchronously buffer the given field. If the field is determined to be a file upload, data may be buffered to disk.- Parameters:
request- The request this field came in onformField- The field- Returns:
- A flow that completes when the full field has been buffered
-
completeAttribute
public ExecutionFlow<CompletedAttribute> completeAttribute(FormCapableHttpRequest<?> request, RawFormField formField) Asynchronously buffer the given attribute.- Parameters:
request- The request this field came in onformField- The field- Returns:
- A flow that completes when the full field has been buffered
-
completeFileUpload
public ExecutionFlow<CompletedFileUpload> completeFileUpload(FormCapableHttpRequest<?> request, RawFormField formField) Buffer a streamedRawFormFieldinto aCompletedFileUpload. May save data to disk, if configured.- Parameters:
request- Optional request, used to get at the ReadBufferFactoryformField- The form field to stream- Returns:
- The flow with the uploaded file
-
streamFileUpload
Create a newStreamingFileUploadfrom the given raw data.- Parameters:
formField- The field- Returns:
- The streaming upload
-