net.sf.xbus.test
Class FileAcceptor

java.lang.Object
  extended by net.sf.xbus.test.FileAcceptor
All Implemented Interfaces:
java.io.FilenameFilter

public class FileAcceptor
extends java.lang.Object
implements java.io.FilenameFilter

Class FileAcceptor implements FilenameFilter interface to filter filenames.
Its instances are used to filter directory listings in the File.list(java.io.FilenameFilter)method. All file names in the returned array must satisfy this filter.

Note: A name satisfies the filter if and only if the value true results when the accept(File, String) method is invoked on this abstract pathname and the name of a file or directory in the directory that it denotes.

Author:
Fleckenstein

Constructor Summary
FileAcceptor(java.lang.String pathname)
          Initializes new Filename filter for the given abstract pathname with checking it on observance of a Separator(WILDCARD) and storing the prefix and postfix of this filename in to class variables.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String filename)
          Tests whether or not the specified file should be included in a file list.
 java.util.List getReplacements()
          Returns the list with all replacements (WILDCARDS)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAcceptor

public FileAcceptor(java.lang.String pathname)
             throws XException
Initializes new Filename filter for the given abstract pathname with checking it on observance of a Separator(WILDCARD) and storing the prefix and postfix of this filename in to class variables.

Parameters:
pathname - abstract path name to be filtered
Throws:
XException - if the filename doesn't contain a seperator or has more than one seperator
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String filename)
Tests whether or not the specified file should be included in a file list. If the file is satisfyd this filter, that stores this method the placeholder to be replace late (substring between prefix and postfix) in vector.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - the directory in which the file was found.
filename - the name of the file to be tested
Returns:
true if and only if filename should be included in the file list; false otherwise.
See Also:
FilenameFilter.accept(File, String)

getReplacements

public java.util.List getReplacements()
Returns the list with all replacements (WILDCARDS)

Returns:
list with all replacements