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 of
application/octet-stream
entity type to/from a File
instance.- Author:
- Paul Sandoz, Marek Potociar
-
Field Summary
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
boolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) readFrom
(Class<File> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) void
writeTo
(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
-
Constructor Details
-
FileProvider
public FileProvider()
-
-
Method Details
-
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:
getSize
in interfaceMessageBodyWriter<File>
- Overrides:
getSize
in classAbstractMessageReaderWriterProvider<File>
-