class NoFileEntityProvider extends FileEntityProvider {

    @Override
    public File readFrom(Class<File> type,
                         Type genericType,
                         Annotation[] annotations,
                         MediaType mediaType,
                         MultivaluedMap<String, String> httpHeaders,
                         InputStream entityStream) throws IOException {
        throw new WebApplicationException(Response.status(BAD_REQUEST).entity(
                "File is not supported as method's parameter.").type(TEXT_PLAIN).build());
    }

}