Class MultipartProvider

java.lang.Object
org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
org.apache.cxf.jaxrs.provider.MultipartProvider
All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<Object>, jakarta.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 jakarta.ws.rs.ext.MessageBodyReader<Object>, jakarta.ws.rs.ext.MessageBodyWriter<Object>
  • Constructor Details

    • MultipartProvider

      public MultipartProvider()
  • Method Details

    • 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, jakarta.ws.rs.core.MediaType mt)
      Specified by:
      isReadable in interface jakarta.ws.rs.ext.MessageBodyReader<Object>
    • checkContentLength

      protected void checkContentLength()
    • readFrom

      public Object readFrom(Class<Object> c, Type t, Annotation[] anns, jakarta.ws.rs.core.MediaType mt, jakarta.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      readFrom in interface jakarta.ws.rs.ext.MessageBodyReader<Object>
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException
    • getSize

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

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

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