Class PathProvider

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<Path>, javax.ws.rs.ext.MessageBodyWriter<Path>

    @Provider
    @Produces({"application/octet-stream","*/*"})
    @Consumes({"application/octet-stream","*/*"})
    @Singleton
    public class PathProvider
    extends Object
    implements javax.ws.rs.ext.MessageBodyReader<Path>, javax.ws.rs.ext.MessageBodyWriter<Path>
    Allow for reading and writing Path objects.

    TODO: remove this once Jersey has been updated.

    Author:
    poirigui
    • Constructor Detail

      • PathProvider

        public PathProvider()
    • Method Detail

      • isReadable

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

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

        public boolean isWriteable​(Class<?> type,
                                   Type genericType,
                                   Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Path>
      • getSize

        public long getSize​(Path path,
                            Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<Path>
      • writeTo

        public void writeTo​(Path path,
                            Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType,
                            javax.ws.rs.core.MultivaluedMap<String,​Object> httpHeaders,
                            OutputStream entityStream)
                     throws IOException,
                            javax.ws.rs.WebApplicationException
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Path>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException