Package org.nuxeo.ecm.webengine.model.io
Class DocumentBlobHolderWriter
java.lang.Object
org.nuxeo.ecm.webengine.model.io.DocumentBlobHolderWriter
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<DocumentBlobHolder>
@Provider
public class DocumentBlobHolderWriter
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<DocumentBlobHolder>
Writer for a
DocumentBlobHolder
, keeping the context of the current document, which allows for later
filtering by the DownloadService
.- Since:
- 9.3
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
long
getSize
(DocumentBlobHolder blobHolder, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) protected void
transferBlob
(Blob blob, OutputStream entityStream) void
writeTo
(DocumentBlobHolder blobHolder, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
-
Field Details
-
request
@Context protected javax.servlet.http.HttpServletRequest request -
response
@Context protected javax.servlet.http.HttpServletResponse response
-
-
Constructor Details
-
DocumentBlobHolderWriter
public DocumentBlobHolderWriter()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
isWriteable
in interfacejavax.ws.rs.ext.MessageBodyWriter<DocumentBlobHolder>
-
getSize
public long getSize(DocumentBlobHolder blobHolder, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<DocumentBlobHolder>
-
writeTo
public void writeTo(DocumentBlobHolder blobHolder, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException- Specified by:
writeTo
in interfacejavax.ws.rs.ext.MessageBodyWriter<DocumentBlobHolder>
- Throws:
IOException
-
commitAndReopenTransaction
protected void commitAndReopenTransaction() -
transferBlob
- Throws:
IOException
-