class DataSourceEntityProvider implements EntityProvider<DataSource> {

    @Override
    public DataSource readFrom(Class<DataSource> type,
                               Type genericType,
                               Annotation[] annotations,
                               MediaType mediaType,
                               MultivaluedMap<String, String> httpHeaders,
                               InputStream entityStream) throws IOException {
        return createDataSource(entityStream, mediaType == null ? null : mediaType.toString());
    }

}