} else { result = put(getConverterService().applyPatch(get(), entity), variant);
/** * Apply a patch entity to the current representation of the resource * retrieved by calling {@link #get()}. By default, the * {@link ConverterService#applyPatch(Representation, Representation)} method is used and then the * {@link #put(Representation)} method called. * * @param entity * The patch entity to apply. * @return The optional result entity. * @throws ResourceException * @see <a href="https://tools.ietf.org/html/rfc5789">HTTP PATCH method</a> */ protected Representation patch(Representation entity) throws ResourceException { AnnotationInfo annotationInfo; try { annotationInfo = getAnnotation(Method.PATCH); if (annotationInfo != null) { return doHandle(Method.PATCH, getQuery(), entity); } else { // Default implementation return put(getConverterService().applyPatch(get(), entity)); // doError(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED); } } catch (IOException e) { throw new ResourceException(e); } }
} else { if (method.equals(Method.PUT)) { result = put(getRequestEntity()); } else if (method.equals(Method.PATCH)) { result = patch(getRequestEntity());
} else { if (method.equals(Method.PUT)) { result = put(getRequestEntity(), variant); } else if (method.equals(Method.PATCH)) { result = patch(getRequestEntity(), variant);