text: public java.net.URI relativize(java.net.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 = Sharpen.StringHelper.Substring(thisPath, 0, thisPath.LastIndexOf('/')+ 1);if (!relativePath.StartsWith(thisPath)){return relative;}}java.net.URI result = new java.net.URI();result.fragment = relative.fragment;result.query = relative.query;result.path = Sharpen.StringHelper.Substring(relativePath, thisPath.Length);result.setSchemeSpecificPart();return result;}