private static boolean matchAllWildcards(String name,String template){
  name=name.toLowerCase(Locale.ENGLISH);
  template=template.toLowerCase(Locale.ENGLISH);
  StringTokenizer nameSt=new StringTokenizer(name,".");
  StringTokenizer templateSt=new StringTokenizer(template,".");
  if (nameSt.countTokens() != templateSt.countTokens()) {
    return false;
  }
  while (nameSt.hasMoreTokens()) {
    if (!matchWildCards(nameSt.nextToken(),templateSt.nextToken())) {
      return false;
    }
  }
  return true;
}

private static boolean matchAllWildcards ( String name , String template ) { name = name . toLowerCase ( Locale . ENGLISH ) ; template = template . toLowerCase ( Locale . ENGLISH ) ; StringTokenizer nameSt = new StringTokenizer ( name , "." ) ; StringTokenizer templateSt = new StringTokenizer ( template , "." ) ; if ( nameSt . countTokens ( ) != templateSt . countTokens ( ) ) { return false ; } while ( nameSt . hasMoreTokens ( ) ) { if ( ! matchWildCards ( nameSt . nextToken ( ) , templateSt . nextToken ( ) ) ) { return false ; } } return true ; }
returns true if name matches against template . < p > according to rfc 2818 , section 3 . 1 - names may contain the wildcard character * which is considered to match any single domain name component or component fragment . e . g . , * . a . com matches foo . a . com but not bar . foo . a . com . f * . com matches foo . com but not bar . com .
