class FileEntityProvider implements EntityProvider<File> {

    @Override
    public void writeTo(File file,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException {
        try (InputStream in = new FileInputStream(file)) {
            ByteStreams.copy(in, entityStream);
        }
    }

}