/** * Overriding broken ServerResource.getVariants method * * NOTE: This is not a caching implementation, so the way it is used may cause it to be a * performance bottleneck. */ @Override protected List<Variant> getVariants(final Method method) { return super.getVariants(method); }
/** * Returns a modifiable list of exposed variants for the current request * method. You can declare variants manually by updating the result list , * by overriding this method. By default, the variants will be provided * based on annotated methods. * * @return The modifiable list of variants. * @throws IOException */ public List<Variant> getVariants() { return getVariants(getMethod()); }
Representation result = null; if ((getVariants() != null) && (!getVariants().isEmpty())) { Variant preferredVariant = getPreferredVariant(getVariants());
Variant preferredVariant = getPreferredVariant(getVariants(Method.GET)); getVariants().clear(); result = doNegotiatedHandle(); } else {