Class URISupport
java.lang.Object
net.shibboleth.idp.plugin.authn.duo.URISupport
URL support class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildOrigin(URI uri) Builds the 'origin' (see RFC 6454) from given URI.static final URIbuildURIIgnoreDefaultPorts(String scheme, String host, int port, String path) Build aURIfrom the given parameters.
-
Constructor Details
-
URISupport
private URISupport()Private constructor.
-
-
Method Details
-
buildURIIgnoreDefaultPorts
@Nonnull public static final URI buildURIIgnoreDefaultPorts(@Nonnull String scheme, @Nonnull String host, int port, @Nonnull String path) throws URISyntaxException Build aURIfrom the given parameters. If the scheme is either 'http' or 'https' with their respective default port, the port is set to -1.- Parameters:
scheme- the schemehost- the hostnameport- the portpath- the path- Returns:
- a fully built URI from the given parameters.
- Throws:
URISyntaxException- if the URI can not be constructed.
-
buildOrigin
Builds the 'origin' (see RFC 6454) from given URI. Omits default or unknown ports.- Parameters:
uri- the URI to build the origin from- Returns:
- the origin
- Throws:
URISyntaxException- if there is an error getting information from the URI.
-