Iterator  it; boolean   match = false; boolean   found = false;  if (matchType == MatchType.PATH) { name = dir.getPath() + System.getProperty ("file.separator") + name; }    for (Pattern pattern : rejectPatterns) { Matcher matcher = pattern.matcher (name);  if (matcher.matches()) { match = false; found = true; break; } }  if (! found) {   if (acceptPatterns.size() == 0) match = true;  else { for (Pattern pattern : acceptPatterns) { Matcher matcher = pattern.matcher (name);  if (matcher.matches()) { match = true; break; } } } }  return match;
return accept (new File (FileUtil.dirname (path)), FileUtil.basename (path));
    public boolean accept (File dir, String name)    {        Iterator  it;        boolean   match = false;        boolean   found = false;        if (matchType == MatchType.PATH)        {            name = dir.getPath()                 + System.getProperty ("file.separator")                 + name;        }        // Check for rejects first.        for (Pattern pattern : rejectPatterns)        {            Matcher matcher = pattern.matcher (name);            if (matcher.matches())            {                match = false;                found = true;                break;            }        }        if (! found)        {            // Check for accepts.            if (acceptPatterns.size() == 0)                match = true;            else            {                for (Pattern pattern : acceptPatterns)                {                    Matcher matcher = pattern.matcher (name);                    if (matcher.matches())                    {                        match = true;                        break;                    }                }            }        }        return match;    }