java.lang.Object
io.helidon.common.uri.UriValidator
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:
- scheme -
validateScheme(String)
- authority -
validateHost(String)
, port is validated in HTTP processing - path - see
UriPath.validate()
- query -
validateQuery(String)
- fragment -
validateFragment(String)
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
validateFragment
(String rawFragment) Validate URI fragment.static void
validateHost
(String host) Validate a host string.static void
validateIpLiteral
(String ipLiteral) An IP literal starts with[
and ends with]
.static void
validateNonIpLiteral
(String host) Validate IPv4 address or a registered name.static void
validateQuery
(String rawQuery) Validate a URI Query raw string.static void
validateScheme
(String scheme) Validate a URI scheme.
-
Method Details
-
validateScheme
Validate a URI scheme.- Parameters:
scheme
- scheme to validate- Throws:
UriValidationException
- in case there are invalid characters in the scheme
-
validateQuery
Validate a URI Query raw string.- Parameters:
rawQuery
- query to validate- Throws:
UriValidationException
- in case there are invalid characters in the query
-
validateHost
Validate a host string.- Parameters:
host
- host to validate- Throws:
UriValidationException
- in case there are invalid characters in the host
-
validateIpLiteral
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
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
Validate URI fragment.- Parameters:
rawFragment
- fragment to validate- Throws:
UriValidationException
- in case there are invalid characters in the fragment
-