private boolean isValidRegistryBasedAuthority(String authority){
  int index=0;
  int end=authority.length();
  char testChar;
  while (index < end) {
    testChar=authority.charAt(index);
    if (testChar == '%') {
      if (index + 2 >= end || !isHex(authority.charAt(index + 1)) || !isHex(authority.charAt(index + 2))) {
        return false;
      }
      index+=2;
    }
 else     if (!isPathCharacter(testChar)) {
      return false;
    }
    ++index;
  }
  return true;
}

private boolean isValidRegistryBasedAuthority ( String authority ) { int index = 0 ; int end = authority . length ( ) ; char testChar ; while ( index < end ) { testChar = authority . charAt ( index ) ; if ( testChar == '%' ) { if ( index + 2 >= end || ! isHex ( authority . charAt ( index + 1 ) ) || ! isHex ( authority . charAt ( index + 2 ) ) ) { return false ; } index += 2 ; } else if ( ! isPathCharacter ( testChar ) ) { return false ; } ++ index ; } return true ; }
determines whether the given string is a registry based authority .
