org.mmbase.util
Class SPartFileFilter

java.lang.Object
  extended by org.mmbase.util.SPartFileFilter
All Implemented Interfaces:
FilenameFilter

public class SPartFileFilter
extends Object
implements FilenameFilter

Support utility for MMObjectBuilder.getSMartPath This filter filters files with the specified number in its name.

Version:
$Id: SPartFileFilter.java 41055 2010-02-15 23:59:16Z michiel $
Author:
Wilbert Hengst
To Do:
move this code to a SmartPathFunction class?

Constructor Summary
SPartFileFilter(String nodeNumber)
          Creates the file filter.
 
Method Summary
 boolean accept(File dir, String name)
          Checks whether a file has the node number in its file path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPartFileFilter

public SPartFileFilter(String nodeNumber)
Creates the file filter.

Parameters:
nodeNumber - the number to filter on.
Method Detail

accept

public boolean accept(File dir,
                      String name)
Checks whether a file has the node number in its file path. This checks on the exact number - so if the number to search on is '100', If the path contains a number such as '1001' or '1100' it will return false.

Specified by:
accept in interface FilenameFilter
Parameters:
dir - The directory as a File (unused in this filter)
name - The file name to check
Returns:
true if the number is in the path, false otherwise.


MMBase 2.0-SNAPSHOT - null