Class UriValidator

java.lang.Object
io.helidon.common.uri.UriValidator

public final class UriValidator extends Object
Validate parts of the URI.

Validation is based on RFC-3986.

The following list provides an overview of parts of URI and how/if we validate it:

  • Method Details

    • validateScheme

      public static void validateScheme(String scheme)
      Validate a URI scheme.
      Parameters:
      scheme - scheme to validate
      Throws:
      UriValidationException - in case there are invalid characters in the scheme
    • validateQuery

      public static void validateQuery(String rawQuery)
      Validate a URI Query raw string.
      Parameters:
      rawQuery - query to validate
      Throws:
      UriValidationException - in case there are invalid characters in the query
    • validateHost

      public static void validateHost(String host)
      Validate a host string.
      Parameters:
      host - host to validate
      Throws:
      UriValidationException - in case there are invalid characters in the host
    • validateIpLiteral

      public static void validateIpLiteral(String ipLiteral)
      An IP literal starts with [ and ends with ].
      Parameters:
      ipLiteral - host literal string, may be an IPv6 address, or IP version future
      Throws:
      UriValidationException - in case there are invalid characters in the host
    • validateNonIpLiteral

      public static void validateNonIpLiteral(String host)
      Validate IPv4 address or a registered name.
      Parameters:
      host - string with either an IPv4 address, or a registered name
      Throws:
      UriValidationException - in case there are invalid characters in the host
    • validateFragment

      public static void validateFragment(String rawFragment)
      Validate URI fragment.
      Parameters:
      rawFragment - fragment to validate
      Throws:
      UriValidationException - in case there are invalid characters in the fragment