class NoFileEntityProvider extends FileEntityProvider {

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

}