com.mindprod.filter
Class AvoidJunkFilter

java.lang.Object
  extended by com.mindprod.filter.JunkFilter
      extended by com.mindprod.filter.AvoidJunkFilter
All Implemented Interfaces:
java.io.FilenameFilter

public final class AvoidJunkFilter
extends JunkFilter
implements java.io.FilenameFilter

Filter to permit only non-junk files.

accept only non-junk files. Can define junk files by name, extension, starts with or endsWith lists, the same as you would JunkFilter. Returns false for all directories.

Since:
2009-05-15
Version:
2.7 2010-11-22 - add optional invert parameter on a number of the filters.
Author:
Roedy Green, Canadian Mind Products

Constructor Summary
AvoidJunkFilter()
          Defines which filenames and extensions are considered junk, to be deleted.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Accept only junk files to be deleted.
 
Methods inherited from class com.mindprod.filter.JunkFilter
setEndsWith, setExtensions, setFilenames, setStartsWith
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvoidJunkFilter

public AvoidJunkFilter()
Defines which filenames and extensions are considered junk, to be deleted.

Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Accept only junk files to be deleted.

Specified by:
accept in interface java.io.FilenameFilter
Overrides:
accept in class JunkFilter
Parameters:
dir - the directory in which the file was found.
name - the name of the file.
Returns:
true if and only if the name should be included in the file list; false otherwise.