result = new URL(uri); setBaseURL(result.toExternalForm()); return result.toExternalForm(); } catch (MalformedURLException e) { try { setBaseURL(new File(".").toURI().toURL().toExternalForm()); } catch (MalformedURLException e1) { XRLog.exception("The default NaiveUserAgent doesn't know how to resolve the base URL for " + uri); return null;
URL result = new URL(uri); ret = result.toString(); } catch (MalformedURLException e) { if (baseURL != null) { try { URL result = new URL(new URL(baseURL), uri); ret = result.toString(); } catch (MalformedURLException e1) { }
    public String resolveURI(String uri) {        URL result;        if (baseURL == null) {            try {                result = new URL(uri);                setBaseURL(result.toExternalForm());                return result.toExternalForm();            } catch (MalformedURLException e) {                try {                    setBaseURL(new File(".").toURI().toURL().toExternalForm());                } catch (MalformedURLException e1) {                    XRLog.exception("The default NaiveUserAgent doesn't know how to resolve the base URL for " + uri);                    return null;                }            }        }        try {            result = new URL(new URL(baseURL), uri);        } catch (MalformedURLException e1) {            XRLog.exception("The default NaiveUserAgent cannot resolve the URL " + uri + " with base URL " + baseURL);            return null;        }        return result.toString();    }