Package org.apache.struts2.rest.handler

# Class MultipartFormDataHandler

java.lang.Object
org.apache.struts2.rest.handler.MultipartFormDataHandler

All Implemented Interfaces:
  `ContentTypeHandler`

public class MultipartFormDataHandler extends Object implements ContentTypeHandler
Handles the default content type for requests that originate from a browser's HTML form with a file upload and multipart/from-data encoding content-type: multipart/form-data This handler is intended for requests only, not for responses

See Also:
  - http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CONTENT_TYPE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MultipartFormDataHandler()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer out)`
  `String`
  `getContentType()`
  Gets the content type for this handler
  `String`
  `getExtension()`
  Gets the extension this handler supports
  `void`
  `toObject(ActionInvocation invocation, Reader in, Object target)`
  No transformation is required as the framework handles this data

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### CONTENT_TYPE

    public static final String CONTENT_TYPE
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MultipartFormDataHandler

    public MultipartFormDataHandler()

- ## Method Details

  - ### fromObject

    public String fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer out) throws IOException
    Specified by:
      `fromObject` in interface `ContentTypeHandler`
    Throws:
      `IOException`

  - ### toObject

    public void toObject(ActionInvocation invocation, Reader in, Object target)
    No transformation is required as the framework handles this data
    Specified by:
      `toObject` in interface `ContentTypeHandler`
    Parameters:
      `in` - The input stream, usually the body of the request
      `target` - The target, usually the action class

  - ### getExtension

    public String getExtension()
    Description copied from interface: `ContentTypeHandler`
    Gets the extension this handler supports
    Specified by:
      `getExtension` in interface `ContentTypeHandler`
    Returns:
      The extension is not used by this handler

  - ### getContentType

    public String getContentType()
    Description copied from interface: `ContentTypeHandler`
    Gets the content type for this handler
    Specified by:
      `getContentType` in interface `ContentTypeHandler`
    Returns:
      The mime type