net.sf.mmm.util.file.base
Class PatternFileFilter

java.lang.Object
  extended by net.sf.mmm.util.file.base.PatternFileFilter
All Implemented Interfaces:
FileFilter

public class PatternFileFilter
extends Object
implements FileFilter

This is the implementation of a FileFilter that filters using a pattern.

Since:
1.0.2
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
PatternCompiler

Field Summary
private  FileType fileType
          The type of the acceptable files or null if any type is acceptable.
private  Pattern pattern
          the pattern that must match in order to accept a file by its name.
 
Constructor Summary
PatternFileFilter(Pattern filenamePattern)
          The constructor.
PatternFileFilter(Pattern filenamePattern, FileType type)
          The constructor.
PatternFileFilter(String filenamePattern, FileType type)
          The constructor.
 
Method Summary
 boolean accept(File file)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

private final Pattern pattern
the pattern that must match in order to accept a file by its name.


fileType

private final FileType fileType
The type of the acceptable files or null if any type is acceptable.

Constructor Detail

PatternFileFilter

public PatternFileFilter(Pattern filenamePattern)
The constructor.

Parameters:
filenamePattern - is the pattern that must match in order to accept a file by its name.

PatternFileFilter

public PatternFileFilter(String filenamePattern,
                         FileType type)
The constructor.

Parameters:
filenamePattern - is the glob-pattern that must match in order to accept a file by its name.
type - the type of the acceptable files or null if any type is acceptable.

PatternFileFilter

public PatternFileFilter(Pattern filenamePattern,
                         FileType type)
The constructor.

Parameters:
filenamePattern - is the pattern that must match in order to accept a file by its name.
type - the type of the acceptable files or null if any type is acceptable.
Method Detail

accept

public boolean accept(File file)

Specified by:
accept in interface FileFilter


Copyright © 2001-2010 mmm-Team. All Rights Reserved.