Class ContentArtifactMessageBodyWriter
java.lang.Object
org.wso2.carbon.governance.rest.api.internal.ContentArtifactMessageBodyWriter
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<ByteArrayInputStream>
@Provider
public class ContentArtifactMessageBodyWriter
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<ByteArrayInputStream>
This message body writer is to handle special case where
a content artifact type consist of application/json data
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(ByteArrayInputStream byteArrayInputStream, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) voidwriteTo(ByteArrayInputStream byteArrayInputStream, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> stringObjectMultivaluedMap, OutputStream outputStream)
-
Constructor Details
-
ContentArtifactMessageBodyWriter
public ContentArtifactMessageBodyWriter()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<ByteArrayInputStream>
-
getSize
public long getSize(ByteArrayInputStream byteArrayInputStream, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<ByteArrayInputStream>
-
writeTo
public void writeTo(ByteArrayInputStream byteArrayInputStream, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> stringObjectMultivaluedMap, OutputStream outputStream) throws IOException, javax.ws.rs.WebApplicationException- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<ByteArrayInputStream>- Throws:
IOExceptionjavax.ws.rs.WebApplicationException
-