Package org.nuxeo.ecm.webengine.model.io
Class DownloadContextBlobHolderWriter
java.lang.Object
org.nuxeo.ecm.webengine.model.io.DownloadContextBlobHolderWriter
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<DownloadContextBlobHolder>
@Provider
public class DownloadContextBlobHolderWriter
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<DownloadContextBlobHolder>
Writer for a
DownloadContextBlobHolder
, keeping the original document context, which allows for later
filtering on document permissions by the DownloadService
.- Since:
- 2021.25
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
long
getSize
(DownloadContextBlobHolder 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) void
writeTo
(DownloadContextBlobHolder 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
-
DownloadContextBlobHolderWriter
public DownloadContextBlobHolderWriter()
-
-
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<DownloadContextBlobHolder>
-
getSize
public long getSize(DownloadContextBlobHolder blobHolder, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<DownloadContextBlobHolder>
-
writeTo
public void writeTo(DownloadContextBlobHolder 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<DownloadContextBlobHolder>
- Throws:
IOException
-
commitAndReopenTransaction
protected void commitAndReopenTransaction()
-