Package net.sf.okapi.common
Class DefaultFilenameFilter
- java.lang.Object
-
- net.sf.okapi.common.DefaultFilenameFilter
-
- All Implemented Interfaces:
FilenameFilter
public class DefaultFilenameFilter extends Object implements FilenameFilter
Implements a default filename filter that supports filtering by wild-cards like ("myFile*.*").
-
-
Constructor Summary
Constructors Constructor Description DefaultFilenameFilter(String extension)Creates a new DefaultFilenameFilter object with a given extension value.DefaultFilenameFilter(String pattern, boolean caseSensitive)Creates a new DefaultFilenameFilter object for a given pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(File directory, String fileName)Accept or reject a given filename.
-
-
-
Constructor Detail
-
DefaultFilenameFilter
public DefaultFilenameFilter(String pattern, boolean caseSensitive)
Creates a new DefaultFilenameFilter object for a given pattern.- Parameters:
pattern- to filter on.caseSensitive- true to use case-sensitive pattern, false otherwise. You can use ? to match any single character and * to match any multiple characters. The pattern is not case-sensitive ("test.*" and "TeSt.*" give the same results) except if specified otherwise.
-
DefaultFilenameFilter
public DefaultFilenameFilter(String extension)
Creates a new DefaultFilenameFilter object with a given extension value. This constructor is for backward compatibility and is equivalent to callingDefaultFilenameFilter("*"+extension, false)- Parameters:
extension- the extension to filter on.
-
-
Method Detail
-
accept
public boolean accept(File directory, String fileName)
Accept or reject a given filename.- Specified by:
acceptin interfaceFilenameFilter- Returns:
- true if the filename is accepted. If the value is null, the method returns false.
-
-