Class StreamingResponseProvider
java.lang.Object
com.atlassian.bamboo.plugins.rest.common.StreamingResponseProvider
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyWriter<StreamingResponse>
@Produces("image/png")
@Provider
public class StreamingResponseProvider
extends Object
implements jakarta.ws.rs.ext.MessageBodyWriter<StreamingResponse>
Adds support for
StreamingResponse entities on Responses.
This provider is registered with JAX-RS via an entry in services/javax.ws.rs.ext.MessageBodyWriter
under META-INF.
When writers are registered as part of Jersey's startup, the per-media-type mapping is sorted by how far the
type parameter is from Object. This encourages Jersey to choose more specialized writers over generic
ones. JacksonJaxbJsonProvider is MessageBodyWriter<Object>, so this writer always
sorts before it in the list. That means, as long as the type being written implements StreamingResponse,
this writer will be chosen to write it.
- Since:
- 9.4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(StreamingResponse streamingResponse, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) voidwriteTo(StreamingResponse response, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
-
Constructor Details
-
StreamingResponseProvider
public StreamingResponseProvider()
-
-
Method Details
-
getSize
public long getSize(StreamingResponse streamingResponse, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfacejakarta.ws.rs.ext.MessageBodyWriter<StreamingResponse>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<StreamingResponse>
-
writeTo
public void writeTo(StreamingResponse response, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<StreamingResponse>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-