HttpUrl url; if (location.startsWith("/")) { url = new HttpUrl(base, location); } else { url = new HttpUrl(location); }
HttpUrl url = new HttpUrl(base, location);
    public void analyse(ConversationID id, Request request, Response response, String origin) {        HttpUrl base = request.getURL();        if (response.getStatus().equals("302")) {            String location = response.getHeader("Location");            if (location != null) {                try {                    HttpUrl url;                    if (location.startsWith("/")) {                        url = new HttpUrl(base, location);                    } else {                        url = new HttpUrl(location);                    }                    _model.addUnseenLink(url, base);                } catch (MalformedURLException mue) {                    _logger.warning("Badly formed Location header : " + location);                }            } else {                _logger.warning("302 received, but no Location header!");            }            return;        }        Object parsed = Parser.parse(base, response);        if (parsed != null && parsed instanceof NodeList) { // the parsed content is HTML            NodeList nodelist = (NodeList) parsed;            processHtml(base, nodelist);            // recurseHtmlNodes(nodelist, base);        } // else maybe it is a parsed Flash document? Anyone? :-)    }