Class JerseyPathReader

java.lang.Object
io.bdeploy.jersey.JerseyPathReader
All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<Path>

@Provider @Consumes("application/octet-stream") public class JerseyPathReader extends Object implements jakarta.ws.rs.ext.MessageBodyReader<Path>
Allows deserializing Path objects (parameter or return value). The actual file content is streamed to a local file and a path to the temporary file is injected.

The recipient of the Path is responsible for cleaning up temporary files.

  • Constructor Details

    • JerseyPathReader

      public JerseyPathReader()
  • Method Details

    • isReadable

      public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      isReadable in interface jakarta.ws.rs.ext.MessageBodyReader<Path>
    • readFrom

      public Path readFrom(Class<Path> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException
      Specified by:
      readFrom in interface jakarta.ws.rs.ext.MessageBodyReader<Path>
      Throws:
      IOException