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 class
FileProvider.FileHolder
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
_downloadDirectory
private static org.jboss.logging.Logger
LOG
private static java.lang.String
PREFIX
private static java.lang.String
SUFFIX
-
Constructor Summary
Constructors Constructor Description FileProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
boolean
isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
boolean
isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
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)
protected void
writeIt(java.io.File uploadFile, java.io.OutputStream entityStream)
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)
-
-
-
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:
isReadable
in 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:
readFrom
in 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:
isWriteable
in 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:
getSize
in 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:
writeTo
in 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
-
-