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 aDocumentBlobHolder
, keeping the context of the current document, which allows for later filtering by theDownloadService
.- Since:
- 9.3
-
-
Constructor Summary
Constructors Constructor Description DocumentBlobHolderWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
commitAndReopenTransaction()
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)
-
-
-
Method Detail
-
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
protected void transferBlob(Blob blob, OutputStream entityStream) throws IOException
- Throws:
IOException
-
-