Class MultipartProvider

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<Object>, javax.ws.rs.ext.MessageBodyWriter<Object>

    @Provider
    @Consumes({"multipart/related","multipart/mixed","multipart/alternative","multipart/form-data"})
    @Produces({"multipart/related","multipart/mixed","multipart/alternative","multipart/form-data"})
    public class MultipartProvider
    extends AbstractConfigurableProvider
    implements javax.ws.rs.ext.MessageBodyReader<Object>, javax.ws.rs.ext.MessageBodyWriter<Object>
    • Constructor Detail

      • MultipartProvider

        public MultipartProvider()
    • Method Detail

      • setMessageContext

        public void setMessageContext​(MessageContext context)
      • setAttachmentDirectory

        public void setAttachmentDirectory​(String dir)
      • setAttachmentThreshold

        public void setAttachmentThreshold​(String threshold)
      • setAttachmentMaxSize

        public void setAttachmentMaxSize​(String maxSize)
      • isReadable

        public boolean isReadable​(Class<?> type,
                                  Type genericType,
                                  Annotation[] annotations,
                                  javax.ws.rs.core.MediaType mt)
        Specified by:
        isReadable in interface javax.ws.rs.ext.MessageBodyReader<Object>
      • checkContentLength

        protected void checkContentLength()
      • getSize

        public long getSize​(Object t,
                            Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>
      • isWriteable

        public boolean isWriteable​(Class<?> type,
                                   Type genericType,
                                   Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mt)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>
      • writeTo

        public void writeTo​(Object obj,
                            Class<?> type,
                            Type genericType,
                            Annotation[] anns,
                            javax.ws.rs.core.MediaType mt,
                            javax.ws.rs.core.MultivaluedMap<String,​Object> headers,
                            OutputStream os)
                     throws IOException,
                            javax.ws.rs.WebApplicationException
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Object>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException