org.openbp.common.io
Class ExtensionFileNameFilter

java.lang.Object
  extended by org.openbp.common.io.ExtensionFileNameFilter
All Implemented Interfaces:
java.io.FilenameFilter

public final class ExtensionFileNameFilter
extends java.lang.Object
implements java.io.FilenameFilter

File name filter for XML files (singleton class).

Author:
Heiko Erhardt

Constructor Summary
ExtensionFileNameFilter(java.lang.String extension)
          Private constructor.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          The method implements the accept method for the FilenameFilter interface, and implements the functionality for comparison of the desired filename to a .xml extension.
static ExtensionFileNameFilter getXmlInstance()
          Gets the singleton instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionFileNameFilter

public ExtensionFileNameFilter(java.lang.String extension)
Private constructor.

Parameters:
extension - Extension to check for; leading '.' will be prepended if not present.
Method Detail

getXmlInstance

public static ExtensionFileNameFilter getXmlInstance()
Gets the singleton instance of this class.


accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
The method implements the accept method for the FilenameFilter interface, and implements the functionality for comparison of the desired filename to a .xml extension.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - Directory in which the file is to be found
name - The file name
Returns:
true If the file is an XML file.
false Otherwise


Copyright © 2011. All Rights Reserved.