Udostępnij za pośrednictwem


URI.Relativize(URI) Method

Definition

Relativizes the given URI against this URI.

[Android.Runtime.Register("relativize", "(Ljava/net/URI;)Ljava/net/URI;", "")]
public Java.Net.URI? Relativize (Java.Net.URI? uri);
[<Android.Runtime.Register("relativize", "(Ljava/net/URI;)Ljava/net/URI;", "")>]
member this.Relativize : Java.Net.URI -> Java.Net.URI

Parameters

uri
URI

The URI to be relativized against this URI

Returns

URI

The resulting URI

Attributes

Remarks

Relativizes the given URI against this URI.

The relativization of the given URI against this URI is computed as follows:

<ol>

<li>

If either this URI or the given URI are opaque, or if the scheme and authority components of the two URIs are not identical, or if the path of this URI is not a prefix of the path of the given URI, then the given URI is returned.

</li>

<li>

Otherwise a new relative hierarchical URI is constructed with query and fragment components taken from the given URI and with a path component computed by removing this URI's path from the beginning of the given URI's path.

</li>

</ol>

Java documentation for java.net.URI.relativize(java.net.URI).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to