public class JunkFileFilter
extends java.lang.Object
implements java.io.FilenameFilter
Constructor and Description |
---|
JunkFileFilter()
Defines which filenames and extensions are considered junk, to be deleted.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File dir,
java.lang.String name)
Accept only junk files to be deleted.
|
void |
setEndsWith(java.lang.String... junkEndsWith)
Set the list of junk ends-with criteria.
|
void |
setExtensions(java.lang.String... junkExtensions)
Set the list of just extensions.
|
void |
setFilenames(java.lang.String... junkFilenames)
Set the list of junk filenames.
|
void |
setStartsWith(java.lang.String... junkStartsWith)
Set the list of junk start
-with criteria.
|
public JunkFileFilter()
public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- the directory in which the file was found.name
- the name of the file.public void setEndsWith(java.lang.String... junkEndsWith)
junkEndsWith
- Array of strings. If file starts this way, it considered junk.public void setExtensions(java.lang.String... junkExtensions)
junkExtensions
- Array of strings defining unqualified, dotless filename extensions considered junk.public void setFilenames(java.lang.String... junkFilenames)
junkFilenames
- Array of strings defining the unqualified, extensionless filenames considered junk.public void setStartsWith(java.lang.String... junkStartsWith)
junkStartsWith
- Array of strings. If file starts this way, it considered junk.