JBoss Common Classes 2.2.17.GA

org.jboss.util.file
Class FilenameSuffixFilter

java.lang.Object
  extended by org.jboss.util.file.FilenameSuffixFilter
All Implemented Interfaces:
FilenameFilter

public class FilenameSuffixFilter
extends Object
implements FilenameFilter

A suffix based filename filter.

Version:
$Revision: 1958 $
Author:
Jason Dillon

Field Summary
protected  boolean ignoreCase
          Flag to signal that we want to ignore the case.
protected  String suffix
          The suffix which files must have to be accepted.
 
Constructor Summary
FilenameSuffixFilter(String suffix)
          Construct a case sensitive FilenameSuffixFilter.
FilenameSuffixFilter(String suffix, boolean ignoreCase)
          Construct a FilenameSuffixFilter.
 
Method Summary
 boolean accept(File dir, String name)
          Check if a file is acceptible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

suffix

protected final String suffix
The suffix which files must have to be accepted.


ignoreCase

protected final boolean ignoreCase
Flag to signal that we want to ignore the case.

Constructor Detail

FilenameSuffixFilter

public FilenameSuffixFilter(String suffix,
                            boolean ignoreCase)
Construct a FilenameSuffixFilter.

Parameters:
suffix - The suffix which files must have to be accepted.
ignoreCase - True if the filter should be case-insensitive.

FilenameSuffixFilter

public FilenameSuffixFilter(String suffix)
Construct a case sensitive FilenameSuffixFilter.

Parameters:
suffix - The suffix which files must have to be accepted.
Method Detail

accept

public boolean accept(File dir,
                      String name)
Check if a file is acceptible.

Specified by:
accept in interface FilenameFilter
Parameters:
dir - The directory the file resides in.
name - The name of the file.
Returns:
true if the file is acceptable.

JBoss Common Classes 2.2.17.GA

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.