Class UriUtil


  • public final class UriUtil
    extends Object
    Utility methods for manipulating URIs.
    • Method Detail

      • resolveToUri

        public static Uri resolveToUri​(@Nullable
                                       String baseUri,
                                       @Nullable
                                       String referenceUri)
        Like resolve(String, String), but returns a Uri instead of a String.
        Parameters:
        baseUri - The base URI.
        referenceUri - The reference URI to resolve.
      • resolve

        public static String resolve​(@Nullable
                                     String baseUri,
                                     @Nullable
                                     String referenceUri)
        Performs relative resolution of a referenceUri with respect to a baseUri.

        The resolution is performed as specified by RFC-3986.

        Parameters:
        baseUri - The base URI.
        referenceUri - The reference URI to resolve.
      • removeQueryParameter

        public static Uri removeQueryParameter​(Uri uri,
                                               String queryParameterName)
        Removes query parameter from an Uri, if present.
        Parameters:
        uri - The uri.
        queryParameterName - The name of the query parameter.
        Returns:
        The uri without the query parameter.