Class FileProvider
- java.lang.Object
-
- org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<File>
-
- org.glassfish.jersey.message.internal.FileProvider
-
- All Implemented Interfaces:
MessageBodyReader<File>,MessageBodyWriter<File>
@Produces({"application/octet-stream","*/*"}) @Consumes({"application/octet-stream","*/*"}) @Singleton public final class FileProvider extends AbstractMessageReaderWriterProvider<File>
Provider for marshalling/un-marshalling ofapplication/octet-streamentity type to/from aFileinstance.- Author:
- Paul Sandoz, Marek Potociar
-
-
Field Summary
-
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
-
-
Constructor Summary
Constructors Constructor Description FileProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetSize(File t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)booleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)FilereadFrom(Class<File> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream)voidwriteTo(File t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)-
Methods inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
getCharset, readFromAsString, writeTo, writeTo, writeToAsString
-
-
-
-
Method Detail
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
-
readFrom
public File readFrom(Class<File> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException
- Throws:
IOException
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
-
writeTo
public void writeTo(File t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException
- Throws:
IOException
-
getSize
public long getSize(File t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
- Specified by:
getSizein interfaceMessageBodyWriter<File>- Overrides:
getSizein classAbstractMessageReaderWriterProvider<File>
-
-