org.pentaho.reporting.libraries.base.util

Class FilesystemFilter

public class FilesystemFilter extends FileFilter implements FilenameFilter

A filesystem filter.

Author: David Gilbert

Constructor Summary
FilesystemFilter(String fileext, String descr)
Creates a new filter.
FilesystemFilter(String fileext, String descr, boolean accDirs)
Creates a new filter.
FilesystemFilter(String[] fileext, String descr, boolean accDirs)
Creates a new filter.
Method Summary
booleanaccept(File dir, String name)
Returns true if the file is accepted, and false otherwise.
booleanaccept(File dir)
Returns true if the specified file matches the requirements of this filter, and false otherwise.
voidacceptDirectories(boolean b)
Sets the flag that controls whether or not the filter accepts directories.
booleanacceptsDirectories()
Returns the flag that indicates whether or not the filter accepts directories.
booleanequals(Object o)
StringgetDescription()
Returns the filter description.
inthashCode()

Constructor Detail

FilesystemFilter

public FilesystemFilter(String fileext, String descr)
Creates a new filter.

Parameters: fileext the file extension. descr the description.

FilesystemFilter

public FilesystemFilter(String fileext, String descr, boolean accDirs)
Creates a new filter.

Parameters: fileext the file extension. descr the description. accDirs accept directories?

FilesystemFilter

public FilesystemFilter(String[] fileext, String descr, boolean accDirs)
Creates a new filter.

Parameters: fileext the file extension. descr the description. accDirs accept directories?

Throws: NullPointerException if the file extensions are null.

Method Detail

accept

public boolean accept(File dir, String name)
Returns true if the file is accepted, and false otherwise.

Parameters: dir the directory. name the file name.

Returns: A boolean.

accept

public boolean accept(File dir)
Returns true if the specified file matches the requirements of this filter, and false otherwise.

Parameters: dir the file or directory.

Returns: A boolean.

acceptDirectories

public void acceptDirectories(boolean b)
Sets the flag that controls whether or not the filter accepts directories.

Parameters: b a boolean.

acceptsDirectories

public boolean acceptsDirectories()
Returns the flag that indicates whether or not the filter accepts directories.

Returns: A boolean.

equals

public boolean equals(Object o)

getDescription

public String getDescription()
Returns the filter description.

Returns: The filter description.

hashCode

public int hashCode()