if (this.isOpaque() != that.isOpaque()) return false; if (!equalIgnoringCase(this.scheme, that.scheme)) return false; if (!equal(this.fragment, that.fragment)) return false; return equal(this.schemeSpecificPart, that.schemeSpecificPart); if (!equal(this.path, that.path)) return false; if (!equal(this.query, that.query)) return false; if (this.host != null) { if (!equal(this.userInfo, that.userInfo)) return false; if (!equalIgnoringCase(this.host, that.host)) return false; if (this.port != that.port) return false; } else if (this.authority != null) { if (!equal(this.authority, that.authority)) return false; } else if (this.authority != that.authority) { return false;
if (this.isOpaque() != that.isOpaque()) return false; if (!equalIgnoringCase(this.scheme, that.scheme)) return false; if (!equal(this.fragment, that.fragment)) return false; return equal(this.schemeSpecificPart, that.schemeSpecificPart); if (!equal(this.path, that.path)) return false; if (!equal(this.query, that.query)) return false; if (this.host != null) { if (!equal(this.userInfo, that.userInfo)) return false; if (!equalIgnoringCase(this.host, that.host)) return false; if (this.port != that.port) return false; } else if (this.authority != null) { if (!equal(this.authority, that.authority)) return false; } else if (this.authority != that.authority) { return false;
private static URI relativize(URI base, URI child) { // check if child if opaque first so that NPE is thrown // if child is null. if (child.isOpaque() || base.isOpaque()) return child; if (!equalIgnoringCase(base.scheme, child.scheme) || !equal(base.authority, child.authority)) return child; String bp = normalize(base.path); String cp = normalize(child.path); if (!bp.equals(cp)) { if (!bp.endsWith("/")) bp = bp + "/"; if (!cp.startsWith(bp)) return child; } URI v = new URI(); v.path = cp.substring(bp.length()); v.query = child.query; v.fragment = child.fragment; return v; }
private static URI relativize(URI base, URI child) { // check if child if opaque first so that NPE is thrown // if child is null. if (child.isOpaque() || base.isOpaque()) return child; if (!equalIgnoringCase(base.scheme, child.scheme) || !equal(base.authority, child.authority)) return child; String bp= normalize(base.path); String cp= normalize(child.path); if (!bp.equals(cp)) { if (!bp.endsWith("/")) bp= bp + "/"; if (!cp.startsWith(bp)) return child; } URI v= new URI(); v.path= cp.substring(bp.length()); v.query= child.query; v.fragment= child.fragment; return v; }
if (!equalIgnoringCase(this.scheme, that.scheme)) return false; if (!equal(this.fragment, that.fragment)) return false; return equal(this.schemeSpecificPart, that.schemeSpecificPart); if (!equal(this.path, that.path)) return false; if (!equal(this.query, that.query)) return false; if (!equal(this.userInfo, that.userInfo)) return false; if (!equalIgnoringCase(this.host, that.host)) if (!equal(this.authority, that.authority)) return false;
private static URI relativize(URI base, URI child) { // check if child if opaque first so that NPE is thrown // if child is null. if (child.isOpaque() || base.isOpaque()) return child; if (!equalIgnoringCase(base.scheme, child.scheme) || !equal(base.authority, child.authority)) return child; String bp = normalize(base.path); String cp = normalize(child.path); if (!bp.equals(cp)) { if (!bp.endsWith("/")) bp = bp + "/"; if (!cp.startsWith(bp)) return child; } URI v = new URI(); v.path = cp.substring(bp.length()); v.query = child.query; v.fragment = child.fragment; return v; }