Package io.bdeploy.jersey
Class JerseyPathWriter
java.lang.Object
io.bdeploy.jersey.JerseyPathWriter
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyWriter<Path>
@Provider
@Produces("application/octet-stream")
public class JerseyPathWriter
extends Object
implements jakarta.ws.rs.ext.MessageBodyWriter<Path>
Allows serializing existing files by returning/accepting
Path
objects. Relies on the counterpart JerseyPathReader to deserialize on
the othe end of the cable into a temporary file.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceSpecifies that the file written to the remote must be deleted after writing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) voidwriteTo(Path t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.ws.rs.ext.MessageBodyWriter
getSize
-
Constructor Details
-
JerseyPathWriter
public JerseyPathWriter()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<Path>
-
writeTo
public void writeTo(Path t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException- Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<Path>- Throws:
IOException
-