Class FilesystemFilter
- java.lang.Object
-
- javax.swing.filechooser.FileFilter
-
- org.pentaho.reporting.libraries.base.util.FilesystemFilter
-
- All Implemented Interfaces:
FilenameFilter
public class FilesystemFilter extends FileFilter implements FilenameFilter
A filesystem filter.- Author:
- David Gilbert
-
-
Constructor Summary
Constructors Constructor Description FilesystemFilter(String[] fileext, String descr, boolean accDirs)
Creates a new filter.FilesystemFilter(String fileext, String descr)
Creates a new filter.FilesystemFilter(String fileext, String descr, boolean accDirs)
Creates a new filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(File dir)
Returnstrue
if the specified file matches the requirements of this filter, andfalse
otherwise.boolean
accept(File dir, String name)
Returnstrue
if the file is accepted, andfalse
otherwise.void
acceptDirectories(boolean b)
Sets the flag that controls whether or not the filter accepts directories.boolean
acceptsDirectories()
Returns the flag that indicates whether or not the filter accepts directories.boolean
equals(Object o)
String
getDescription()
Returns the filter description.int
hashCode()
-
-
-
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)
Returnstrue
if the file is accepted, andfalse
otherwise.- Specified by:
accept
in interfaceFilenameFilter
- Parameters:
dir
- the directory.name
- the file name.- Returns:
- A boolean.
-
accept
public boolean accept(File dir)
Returnstrue
if the specified file matches the requirements of this filter, andfalse
otherwise.- Specified by:
accept
in classFileFilter
- Parameters:
dir
- the file or directory.- Returns:
- A boolean.
-
getDescription
public String getDescription()
Returns the filter description.- Specified by:
getDescription
in classFileFilter
- Returns:
- The filter description.
-
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.
-
-