net.sf.doolin.util
Class PatternFileFilter

java.lang.Object
  extended by net.sf.doolin.util.PatternFileFilter
All Implemented Interfaces:
FileFilter

public class PatternFileFilter
extends Object
implements FileFilter

This pattern works with DOS like patterns. Only the "*" wildcard is supported.

Author:
Damien Coraboeuf
See Also:
PatternFormat

Constructor Summary
PatternFileFilter(String pattern)
          Initialization
 
Method Summary
 boolean accept(File file)
           
 boolean accept(String fileName)
          Checks if a file name (or any string) complies with the pattern.
 String format(Object... params)
          Format a string using some parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternFileFilter

public PatternFileFilter(String pattern)
Initialization

Parameters:
pattern - Pattern to be used.
Method Detail

accept

public boolean accept(File file)
Specified by:
accept in interface FileFilter
See Also:
FileFilter.accept(File)

accept

public boolean accept(String fileName)
Checks if a file name (or any string) complies with the pattern.

Parameters:
fileName - String to check
Returns:
Result of the check.
See Also:
PatternFormat.accept(String)

format

public String format(Object... params)
Format a string using some parameters.

Parameters:
params - Parameters to include in the formatted string
Returns:
Formatted string.
See Also:
PatternFormat.format(Object[])


Copyright © 2011. All Rights Reserved.