Class URISupport
- java.lang.Object
-
- net.shibboleth.idp.plugin.authn.duo.URISupport
-
@ThreadSafe public final class URISupport extends Object
URL support class.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateURISupport()Private constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbuildOrigin(URI uri)Builds the 'origin' (see RFC 6454) from given URI.static URIbuildURIIgnoreDefaultPorts(String scheme, String host, int port, String path)Build aURIfrom the given parameters.
-
-
-
Method Detail
-
buildURIIgnoreDefaultPorts
@Nonnull public static final URI buildURIIgnoreDefaultPorts(@Nonnull String scheme, @Nonnull String host, @Nonnull 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
@Nonnull public static String buildOrigin(@Nonnull URI uri) throws URISyntaxException
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.
-
-