replyTo += "&xoauth_end_user_decision=" + decision.toLowerCase();
return confirmAuthorization(replyTo);
}
private String evaluateBody(InputStream body, String expression) {
XPath xpath = XPathFactory.newInstance().newXPath();
xpath.setNamespaceContext(new NamespaceContextImpl(
Collections.singletonMap("ns", "http://org.jboss.com/resteasy/oauth")));
try {
Object result = (Object)xpath.evaluate(expression, new InputSource(body), XPathConstants.STRING);
return (String)result;
} catch (XPathExpressionException ex) {
throw new IllegalArgumentException("Illegal XPath expression '" + expression + "'", ex);
}