Class FileWriter

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyWriter<File>

    @Provider
    public class FileWriter
    extends Object
    implements javax.ws.rs.ext.MessageBodyWriter<File>
    text/plain is needed otherwise resteasy will use its default text plain (@see DefaultTextPlain) writer to write text/plain objects and the file is not written correctly.
    Author:
    Bogdan Stefanescu
    • Method Detail

      • getSize

        public long getSize​(File arg0,
                            Class<?> arg1,
                            Type arg2,
                            Annotation[] arg3,
                            javax.ws.rs.core.MediaType arg4)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<File>
      • isWriteable

        public boolean isWriteable​(Class<?> arg0,
                                   Type type,
                                   Annotation[] arg2,
                                   javax.ws.rs.core.MediaType arg3)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<File>