private String toAbsolute(String location) {

        if (location == null) {
            return location;
        }

        boolean leadingSlash = location.startsWith("/");

        if (leadingSlash || !hasScheme(location)) {
            return RedirectBuilder.redirect(exchange, location, false);
        } else {
            return location;
        }

    }
private String toAbsolute ( String location ) { if ( location == null ) { return location ; } boolean leadingSlash = location . startsWith ( "/" ) ; if ( leadingSlash || ! hasScheme ( location ) ) { return RedirectBuilder . redirect ( exchange , location , false ) ; } else { return location ; } }
Convert (if necessary) and return the absolute URL that represents the
resource referenced by this possibly relative URL.  If this URL is
already absolute, return it unchanged.

@param location URL to be (possibly) converted and then returned
@throws IllegalArgumentException if a MalformedURLException is
thrown when converting the relative URL to an absolute one