Class FileProvider
- java.lang.Object
-
- org.jboss.resteasy.plugins.providers.FileProvider
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<java.io.File>,javax.ws.rs.ext.MessageBodyWriter<java.io.File>
@Provider @Produces("*/*") @Consumes("*/*") public class FileProvider extends java.lang.Object implements javax.ws.rs.ext.MessageBodyReader<java.io.File>, javax.ws.rs.ext.MessageBodyWriter<java.io.File>- Version:
- $Revision: 1 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFileProvider.FileHolder
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String_downloadDirectoryprivate static org.jboss.logging.LoggerLOGprivate static java.lang.StringPREFIXprivate static java.lang.StringSUFFIX
-
Constructor Summary
Constructors Constructor Description FileProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetSize(java.io.File o, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)java.io.FilereadFrom(java.lang.Class<java.io.File> 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.String> httpHeaders, java.io.InputStream entityStream)protected voidwriteIt(java.io.File uploadFile, java.io.OutputStream entityStream)voidwriteTo(java.io.File uploadFile, 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)
-
-
-
Field Detail
-
LOG
private static final org.jboss.logging.Logger LOG
-
PREFIX
private static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
SUFFIX
private static final java.lang.String SUFFIX
- See Also:
- Constant Field Values
-
_downloadDirectory
private java.lang.String _downloadDirectory
-
-
Method Detail
-
isReadable
public boolean isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
isReadablein interfacejavax.ws.rs.ext.MessageBodyReader<java.io.File>
-
readFrom
public java.io.File readFrom(java.lang.Class<java.io.File> 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.String> httpHeaders, java.io.InputStream entityStream) throws java.io.IOException- Specified by:
readFromin interfacejavax.ws.rs.ext.MessageBodyReader<java.io.File>- Throws:
java.io.IOException
-
isWriteable
public boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<java.io.File>
-
getSize
public long getSize(java.io.File o, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<java.io.File>
-
writeTo
public void writeTo(java.io.File uploadFile, 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:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<java.io.File>- Throws:
java.io.IOException
-
writeIt
protected void writeIt(java.io.File uploadFile, java.io.OutputStream entityStream) throws java.io.IOException- Throws:
java.io.IOException
-
-