When a server is running behind a proxy - sometimes the URL in the request object is simply wrong but the software knows that the URL should be. This adds two methods:
The second parameter is the URL where the world thinks the server is. What you get back is the URL that you were actually called from beyond the proxy rather than the URL the proxy may have called you.
This is of particular value when validating an incoming OAuth message and giving it the URL to override the URL that is likely wrong in the HTTP request object:
OAuthMessage oam = OAuthServlet.getMessage(request, realPath);