public String encodedUsername ( ) { if ( username . isEmpty ( ) ) return "" ; int usernameStart = scheme . length ( ) + 3 ; // "://".length() == 3. int usernameEnd = delimiterOffset ( url , usernameStart , url . length ( ) , ":@" ) ; return url . substring ( usernameStart , usernameEnd ) ; }
Returns the username or an empty string if none is set .