class NoFileEntityProvider extends FileEntityProvider {

    @Override
    public long getSize(File file, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
        throw new WebApplicationException(Response.status(BAD_REQUEST).entity(
                "File is not supported as method's parameter.").type(TEXT_PLAIN).build());
    }

}