1 /* $Id: Wildcards.java,v 1.1.1.1 2003/02/11 16:19:41 bures Exp $ */2 package SOFA.Util;3 4 /** Wildcards (*,?) matcher class.5 * 6 * @author Petr Hnetynka7 */8 public class Wildcards {9 10 /** Matches the string with wildcards against a string.11 * @param str matched string12 * @param expr string with wildcards13 * @return <tt>true</tt> if string matched14 */15 public static boolean match(String str, String expr) {16 17 // to be implemented correctly later18 if (expr.endsWith("*")) {19 20 return str.startsWith(expr.substring(0, expr.length() - 1));21 }22 else23 return expr.equals(str);24 }25 } 26