text: public URI relativize(URI relative) {if (relative.opaque || opaque) {return relative;}if (scheme == null ? relative.scheme != null : !scheme.equals(relative.scheme)) {return relative;}if (authority == null ? relative.authority != null : !authority.equals(relative.authority)) {return relative;}String thisPath = normalize(path, false);String relativePath = normalize(relative.path, false);if (!thisPath.equals(relativePath)) {thisPath = thisPath.substring(0, thisPath.lastIndexOf('/') + 1);if (!relativePath.startsWith(thisPath)) {return relative;}}URI result = new URI();result.fragment = relative.fragment;result.query = relative.query;result.path = relativePath.substring(thisPath.length());result.setSchemeSpecificPart();return result;}