Code example for URL

Methods: toExternalForm

0
        sb.append(ParsingUtilities.encode(request.getParameter("winname")));
        sb.append("&cb=");
        sb.append(ParsingUtilities.encode(request.getParameter("cb")));
     
        URL thisUrl = new URL(request.getRequestURL().toString());
        URL authorizedUrl = new URL(thisUrl, sb.toString());
        return authorizedUrl.toExternalForm();
    } 
 
    static public String getTokenFromCode(ButterflyModule module, HttpServletRequest request) 
            throws MalformedURLException { 
        String redirectUrl = makeRedirectUrl(module, request);
        StringBuffer fullUrlBuf = request.getRequestURL();
        if (request.getQueryString() != null) {
          fullUrlBuf.append('?').append(request.getQueryString());
        } 
        AuthorizationCodeResponseUrl authResponse =
            new AuthorizationCodeResponseUrl(fullUrlBuf.toString());
        // check for user-denied error 
        if (authResponse.getError() != null) {
Connect your IDE to all the code out there  Get Codota for Java