|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.io.filefilter.AbstractFileFilter
gov.nasa.pds.tools.file.filefilter.WildcardOSFilter
public class WildcardOSFilter
Filters files using supplied wildcard(s). Based on the Apache WildcardFilter class in the Commons IO package. Difference is that in this class, it uses the org.apache.commons.io.FilenameUtils.wildcardMatchOnSystem() for its matching rules, which means that pattern matching using this class is OS dependent (case-insensitive on Windows and case-sensitive on Unix, Linux, MAC)
Constructor Summary | |
---|---|
WildcardOSFilter(java.util.List wc)
Constructor for a list of wildcards |
|
WildcardOSFilter(java.lang.String wc)
Constructor for a single wildcard |
Method Summary | |
---|---|
boolean |
accept(java.io.File file)
Checks to see if the filename matches one of the wildcards. |
boolean |
accept(java.io.File dir,
java.lang.String name)
Checks to see if the filename matches one of the wildcards. |
java.util.List |
getWildcards()
Returns list of filters that were set |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WildcardOSFilter(java.lang.String wc)
wc
- a single filter to set
java.lang.NullPointerException
- if the pattern is nullpublic WildcardOSFilter(java.util.List wc)
wc
- a list of filters to set
java.lang.NullPointerException
- if the pattern list is nullMethod Detail |
---|
public java.util.List getWildcards()
public boolean accept(java.io.File file)
accept
in interface java.io.FileFilter
accept
in interface org.apache.commons.io.filefilter.IOFileFilter
accept
in class org.apache.commons.io.filefilter.AbstractFileFilter
file
- the file to check
java.lang.NullPointerException
- if the file is nullpublic boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
accept
in interface org.apache.commons.io.filefilter.IOFileFilter
accept
in class org.apache.commons.io.filefilter.AbstractFileFilter
dir
- the directory to checkname
- the file name within the directory to check
java.lang.NullPointerException
- if the file is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |