public static String getScheme ( final URI uri ) throws NormalizationException { final String scheme = Strings . emptyToNull ( uri . getScheme ( ) ) ; if ( scheme == null && hasPort ( uri ) ) { return NetProtocol . find ( getPort ( uri ) , DEFAULT_PROTOCOL ) . getScheme ( ) ; } else if ( scheme == null ) { return DEFAULT_PROTOCOL . getScheme ( ) ; } return scheme ; }
Returns the scheme of the given URI or the scheme of the URI s port if there is a port . If there is no default then the scheme of the default protocol is returned .