Package org.apache.cxf.jaxrs.provider
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
long
getSize
(Object t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) boolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt) readFrom
(Class<Object> c, Type t, Annotation[] anns, jakarta.ws.rs.core.MediaType mt, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, InputStream is) void
void
setAttachmentMaxSize
(String maxSize) void
setAttachmentThreshold
(String threshold) void
setMessageContext
(MessageContext context) 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) Methods inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
getBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, init, isPayloadEmpty, isPayloadEmpty, reportEmptyContentLength, setBus, setConsumeMediaTypes, setEnableBuffering, setEnableStreaming, setProduceMediaTypes
-
Constructor Details
-
MultipartProvider
public MultipartProvider()
-
-
Method Details
-
setMessageContext
-
setAttachmentDirectory
-
setAttachmentThreshold
-
setAttachmentMaxSize
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt) - Specified by:
isReadable
in interfacejakarta.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 interfacejakarta.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 interfacejakarta.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 interfacejakarta.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 interfacejakarta.ws.rs.ext.MessageBodyWriter<Object>
- Throws:
IOException
jakarta.ws.rs.WebApplicationException
-