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
      T createAttribute​(java.lang.String name, java.lang.String value)
      Creates an attribute.
      T createFileUpload​(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.
      void setContent​(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 file
        filename - The file name
        contentType - The content type
        encoding - The encoding
        charset - The charset
        length - 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 attribute
        value - 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 object
        content - The content
        Throws:
        java.io.IOException - When the content cannot be set