public final class UriUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getNonEmptyPath(MutableUri uri)
Returns / when the given
uri has no path component, returns the uri path otherwise. |
static int |
getPort(String scheme,
int port)
Returns the default's protocol port if not set in the given URI
scheme , the URI port otherwise. |
static boolean |
isSecure(String scheme)
Returns
true if the given URI scheme is for a secure (TLS) connection. |
public static boolean isSecure(String scheme)
true
if the given URI scheme is for a secure (TLS) connection.scheme
- URI schemetrue
if the given URI scheme is for a secure (TLS) connection.public static String getNonEmptyPath(MutableUri uri)
uri
has no path component, returns the uri path otherwise.
Convenient for HTTP layer when targeting server root
uri
- request's uripublic static int getPort(String scheme, int port)
scheme
, the URI port otherwise.scheme
- URI schemeport
- port as returned by the URI
(can be -1 if unset)scheme
, the URI port otherwise.Copyright 2011-2017 ForgeRock AS.