Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.webengine.model.io
Class FileWriter

java.lang.Object
  extended by org.nuxeo.ecm.webengine.model.io.FileWriter
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<java.io.File>

@Provider
public class FileWriter
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyWriter<java.io.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

Constructor Summary
FileWriter()
           
 
Method Summary
 long getSize(java.io.File arg0, java.lang.Class<?> arg1, java.lang.reflect.Type arg2, java.lang.annotation.Annotation[] arg3, javax.ws.rs.core.MediaType arg4)
           
 boolean isWriteable(java.lang.Class<?> arg0, java.lang.reflect.Type type, java.lang.annotation.Annotation[] arg2, javax.ws.rs.core.MediaType arg3)
           
 void writeTo(java.io.File t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileWriter

public FileWriter()
Method Detail

writeTo

public void writeTo(java.io.File t,
                    java.lang.Class<?> type,
                    java.lang.reflect.Type genericType,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders,
                    java.io.OutputStream entityStream)
             throws java.io.IOException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<java.io.File>
Throws:
java.io.IOException

getSize

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

isWriteable

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

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.