org.jboss.resteasy.plugins.providers.multipart

## Class MimeMultipartProvider

- java.lang.Object
- - org.jboss.resteasy.plugins.providers.AbstractEntityProvider<javax.mail.internet.MimeMultipart>
  - - org.jboss.resteasy.plugins.providers.multipart.MimeMultipartProvider

- All Implemented Interfaces:
    MessageBodyReader<javax.mail.internet.MimeMultipart>, MessageBodyWriter<javax.mail.internet.MimeMultipart>

      @Provider
      @Produces(value="multipart/mixed")
      @Consumes(value={"multipart/mixed","multipart/form-data"})
      public class MimeMultipartProvider
      extends AbstractEntityProvider<javax.mail.internet.MimeMultipart>

  A provider to handle multipart representations. This implementation will be invoked when a method parameter takes a `MimeMultipart` as a method parameter or a return value and the
  Author:
    Ryan J. McDonough

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MimeMultipartProvider()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Ascertain if the MessageBodyReader can produce an instance of a particular type.
    `boolean` | `isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Ascertain if the MessageBodyWriter supports a particular type.
    `static DataSource` | `readDataSource(InputStream in, MediaType mediaType)`
    `javax.mail.internet.MimeMultipart` | `readFrom(Class<javax.mail.internet.MimeMultipart> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream)` FIXME Comment this
    `void` | `writeTo(javax.mail.internet.MimeMultipart mimeMultipart, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)` FIXME Comment this

    - ### Methods inherited from class org.jboss.resteasy.plugins.providers.AbstractEntityProvider

      `getSize`

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

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

- - ### Constructor Detail

    - #### MimeMultipartProvider

          public MimeMultipartProvider()

  - ### Method Detail

    - #### readDataSource

          public static DataSource readDataSource(InputStream in,
                                  MediaType mediaType)
                                           throws IOException

      Parameters:
        `in` -
        `mediaType` -
      Returns:
      Throws:
        `IOException`

    - #### isReadable

          public boolean isReadable(Class<?> type,
                           Type genericType,
                           Annotation[] annotations,
                           MediaType mediaType)

      Description copied from interface: `MessageBodyReader`
      Ascertain if the MessageBodyReader can produce an instance of a particular type. The `type` parameter gives the class of the instance that should be produced, the `genericType` parameter gives the `java.lang.reflect.Type` of the instance that should be produced. E.g. if the instance to be produced is `List<String>`, the `type` parameter will be `java.util.List` and the `genericType` parameter will be `java.lang.reflect.ParameterizedType`.
      Parameters:
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` - the media type of the HTTP entity, if one is not specified in the request then `application/octet-stream` is used.
      Returns:

    - #### isWriteable

          public boolean isWriteable(Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            MediaType mediaType)

      Description copied from interface: `MessageBodyWriter`
      Ascertain if the MessageBodyWriter supports a particular type.
      Parameters:
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` - the media type of the HTTP entity.
      Returns:

    - #### readFrom

          public javax.mail.internet.MimeMultipart readFrom(Class<javax.mail.internet.MimeMultipart> type,
                                                   Type genericType,
                                                   Annotation[] annotations,
                                                   MediaType mediaType,
                                                   MultivaluedMap<String,String> httpHeaders,
                                                   InputStream entityStream)
                                                     throws IOException

      FIXME Comment this
      Parameters:
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` -
        `httpHeaders` -
        `entityStream` -
      Returns:
      Throws:
        `IOException`
        `WebApplicationException`
      See Also:
        `javax.ws.rs.ext.MessageBodyReader#readFrom(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream)`

    - #### writeTo

          public void writeTo(javax.mail.internet.MimeMultipart mimeMultipart,
                     Class<?> type,
                     Type genericType,
                     Annotation[] annotations,
                     MediaType mediaType,
                     MultivaluedMap<String,Object> httpHeaders,
                     OutputStream entityStream)
                       throws IOException

      FIXME Comment this
      Parameters:
        `mimeMultipart` -
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` -
        `httpHeaders` -
        `entityStream` -
      Throws:
        `IOException`
      See Also:
        `javax.ws.rs.ext.MessageBodyWriter#writeTo(java.lang.Object, java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.OutputStream)`

Copyright © 2014. All Rights Reserved.