public static boolean isAbsolute ( String uri ) { int i = uri . indexOf ( ' ' ) ; if ( i < 0 ) return false ; while ( -- i >= 0 ) { switch ( uri . charAt ( i ) ) { case ' ' : case ' ' : case ' ' : return false ; } } return true ; }
Tests whether a valid URI reference is absolute . It is allowed to pass an invalid URI reference but the result is not defined . It is also allowed to pass a valid URI with leading and trailing whitespace .