2222import org .apache .commons .io .FileUtils ;
2323
2424/**
25- * Filters files based on a cutoff time, can filter either older or newer files.
25+ * Filters files based on a cutoff time, can filter either newer
26+ * files or files equal to or older.
2627 * <p>
2728 * For example, to print all files and directories in the
2829 * current directory older than one day:
@@ -49,7 +50,8 @@ public class AgeFileFilter extends AbstractFileFilter {
4950 private boolean acceptOlder ;
5051
5152 /**
52- * Constructs a new age file filter for files older than a certain cutoff.
53+ * Constructs a new age file filter for files equal to or older than
54+ * a certain cutoff
5355 *
5456 * @param cutoff the threshold age of the files
5557 */
@@ -62,16 +64,17 @@ public AgeFileFilter(long cutoff) {
6264 * of a certain cutoff.
6365 *
6466 * @param cutoff the threshold age of the files
65- * @param acceptOlder if true, older files are accepted, else newer ones
67+ * @param acceptOlder if true, older files (at or before the cutoff)
68+ * are accepted, else newer ones (after the cutoff).
6669 */
6770 public AgeFileFilter (long cutoff , boolean acceptOlder ) {
6871 this .acceptOlder = acceptOlder ;
6972 this .cutoff = cutoff ;
7073 }
7174
7275 /**
73- * Constructs a new age file filter for files older than a certain
74- * cutoff date.
76+ * Constructs a new age file filter for files older than (at or before)
77+ * a certain cutoff date.
7578 *
7679 * @param cutoffDate the threshold age of the files
7780 */
@@ -84,15 +87,16 @@ public AgeFileFilter(Date cutoffDate) {
8487 * of a certain cutoff date.
8588 *
8689 * @param cutoffDate the threshold age of the files
87- * @param acceptOlder if true, older files are accepted, else newer ones
90+ * @param acceptOlder if true, older files (at or before the cutoff)
91+ * are accepted, else newer ones (after the cutoff).
8892 */
8993 public AgeFileFilter (Date cutoffDate , boolean acceptOlder ) {
9094 this (cutoffDate .getTime (), acceptOlder );
9195 }
9296
9397 /**
94- * Constructs a new age file filter for files older than a certain
95- * File (whose last modification time will be used as reference).
98+ * Constructs a new age file filter for files older than (at or before)
99+ * a certain File (whose last modification time will be used as reference).
96100 *
97101 * @param cutoffReference the file whose last modification
98102 * time is usesd as the threshold age of the files
@@ -108,7 +112,8 @@ public AgeFileFilter(File cutoffReference) {
108112 *
109113 * @param cutoffReference the file whose last modification
110114 * time is usesd as the threshold age of the files
111- * @param acceptOlder if true, older files are accepted, else newer ones
115+ * @param acceptOlder if true, older files (at or before the cutoff)
116+ * are accepted, else newer ones (after the cutoff).
112117 */
113118 public AgeFileFilter (File cutoffReference , boolean acceptOlder ) {
114119 this (cutoffReference .lastModified (), acceptOlder );
@@ -118,7 +123,11 @@ public AgeFileFilter(File cutoffReference, boolean acceptOlder) {
118123 /**
119124 * Checks to see if the last modification of the file matches cutoff
120125 * favorably.
121- * If last modification time equals cutoff, file is not selected.
126+ * <p>
127+ * If last modification time equals cutoff and newer files are required,
128+ * file <b>IS NOT</b> selected.
129+ * If last modification time equals cutoff and older files are required,
130+ * file <b>IS</b> selected.
122131 *
123132 * @param file the File to check
124133 * @return true if the filename matches
0 commit comments