Interface MultipartDataFactory<T>
-
- Type Parameters:
T- The file upload type
public interface MultipartDataFactory<T>A factory for Multipart data.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TcreateAttribute(java.lang.String name, java.lang.String value)Creates an attribute.TcreateFileUpload(java.lang.String name, java.lang.String filename, io.micronaut.http.MediaType contentType, java.lang.String encoding, java.nio.charset.Charset charset, long length)Creates a file upload.voidsetContent(T fileUploadObject, java.lang.Object content)Sets the content on the file upload object.
-
-
-
Method Detail
-
createFileUpload
@NonNull T createFileUpload(@NonNull java.lang.String name, @NonNull java.lang.String filename, @NonNull io.micronaut.http.MediaType contentType, @Nullable java.lang.String encoding, @Nullable java.nio.charset.Charset charset, long length)
Creates a file upload.- Parameters:
name- The name of the filefilename- The file namecontentType- The content typeencoding- The encodingcharset- The charsetlength- The length- Returns:
- The file upload
-
createAttribute
@NonNull T createAttribute(@NonNull java.lang.String name, @NonNull java.lang.String value)
Creates an attribute.- Parameters:
name- The name of the attributevalue- The value of the attribute- Returns:
- The attribute
-
setContent
void setContent(T fileUploadObject, java.lang.Object content) throws java.io.IOException
Sets the content on the file upload object.- Parameters:
fileUploadObject- The file upload objectcontent- The content- Throws:
java.io.IOException- When the content cannot be set
-
-