# Class FilePatternMatcher

java.lang.Object
net.sf.statcvs.util.FilePatternMatcher

public class FilePatternMatcher extends Object

Matches filenames against an Ant-style wildcard pattern list.

In short, ? matches one character, * matches zero or more characters but no directory changes (it doesn't match / or \), and ** matches zero or more directory levels. If the wildcard pattern ends in / or \, an implicit ** is added.

Several patterns can be specified, seperated by : or ;.

Everything is case sensitive. If you need case insensitive pattern matching, use `String.toLower()` on the pattern and on the candidate string.

Version:
  $Id: FilePatternMatcher.java,v 1.3 2008/04/02 11:22:15 benoitx Exp $
Author:
  Richard Cyganiak invalid input: '<'rcyg@gmx.de>

## Constructor Summary

Constructors
Constructor
Description
`FilePatternMatcher(String wildcardPattern)`
Creates a matcher to match filenames against a specified wildcard pattern

## Method Summary

Modifier and Type
Method
Description
`boolean`
`matches(String filename)`
Matches a filename against the wildcard pattern.
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### FilePatternMatcher

public FilePatternMatcher(String wildcardPattern)
Creates a matcher to match filenames against a specified wildcard pattern

Parameters:
  `wildcardPattern` - an Ant-style wildcard pattern

## Method Details

### matches

public boolean matches(String filename)
Matches a filename against the wildcard pattern.

Parameters:
  `filename` - a filename
Returns:
  `true` if the filename matches the pattern

### toString

public String toString()

Overrides:
  `toString` in class `Object`