Author: niallp Date: Thu Oct 12 23:14:41 2006 New Revision: 463570 URL: http://svn.apache.org/viewvc?view=rev&rev=463570 Log: IO-89 - Correct AgeFileFilter Javadocs to reflect that it filters either newer files or files equal to or older than the cutoff. Correct SizeFileFilter Javadocs to reflect that it filters either smaller files or files equal to or larger than the threshold.
Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/AgeFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/SizeFileFilter.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/AgeFileFilter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/AgeFileFilter.java?view=diff&rev=463570&r1=463569&r2=463570 ============================================================================== --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/AgeFileFilter.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/AgeFileFilter.java Thu Oct 12 23:14:41 2006 @@ -22,7 +22,8 @@ import org.apache.commons.io.FileUtils; /** - * Filters files based on a cutoff time, can filter either older or newer files. + * Filters files based on a cutoff time, can filter either newer + * files or files equal to or older. * <p> * For example, to print all files and directories in the * current directory older than one day: @@ -49,7 +50,8 @@ private boolean acceptOlder; /** - * Constructs a new age file filter for files older than a certain cutoff. + * Constructs a new age file filter for files equal to or older than + * a certain cutoff * * @param cutoff the threshold age of the files */ @@ -62,7 +64,8 @@ * of a certain cutoff. * * @param cutoff the threshold age of the files - * @param acceptOlder if true, older files are accepted, else newer ones + * @param acceptOlder if true, older files (at or before the cutoff) + * are accepted, else newer ones (after the cutoff). */ public AgeFileFilter(long cutoff, boolean acceptOlder) { this.acceptOlder = acceptOlder; @@ -70,8 +73,8 @@ } /** - * Constructs a new age file filter for files older than a certain - * cutoff date. + * Constructs a new age file filter for files older than (at or before) + * a certain cutoff date. * * @param cutoffDate the threshold age of the files */ @@ -84,15 +87,16 @@ * of a certain cutoff date. * * @param cutoffDate the threshold age of the files - * @param acceptOlder if true, older files are accepted, else newer ones + * @param acceptOlder if true, older files (at or before the cutoff) + * are accepted, else newer ones (after the cutoff). */ public AgeFileFilter(Date cutoffDate, boolean acceptOlder) { this(cutoffDate.getTime(), acceptOlder); } /** - * Constructs a new age file filter for files older than a certain - * File (whose last modification time will be used as reference). + * Constructs a new age file filter for files older than (at or before) + * a certain File (whose last modification time will be used as reference). * * @param cutoffReference the file whose last modification * time is usesd as the threshold age of the files @@ -108,7 +112,8 @@ * * @param cutoffReference the file whose last modification * time is usesd as the threshold age of the files - * @param acceptOlder if true, older files are accepted, else newer ones + * @param acceptOlder if true, older files (at or before the cutoff) + * are accepted, else newer ones (after the cutoff). */ public AgeFileFilter(File cutoffReference, boolean acceptOlder) { this(cutoffReference.lastModified(), acceptOlder); @@ -118,7 +123,11 @@ /** * Checks to see if the last modification of the file matches cutoff * favorably. - * If last modification time equals cutoff, file is not selected. + * <p> + * If last modification time equals cutoff and newer files are required, + * file <b>IS NOT</b> selected. + * If last modification time equals cutoff and older files are required, + * file <b>IS</b> selected. * * @param file the File to check * @return true if the filename matches Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/SizeFileFilter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/SizeFileFilter.java?view=diff&rev=463570&r1=463569&r2=463570 ============================================================================== --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/SizeFileFilter.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/SizeFileFilter.java Thu Oct 12 23:14:41 2006 @@ -19,8 +19,8 @@ import java.io.File; /** - * Filters files based on size, can filter either larger or smaller files - * as compared to a given threshold. + * Filters files based on size, can filter either smaller files or + * files equal to or larger than a given threshold. * <p> * For example, to print all files and directories in the * current directory whose size is greater than 1 MB: @@ -45,7 +45,8 @@ private boolean acceptLarger; /** - * Constructs a new size file filter for files larger than a certain size. + * Constructs a new size file filter for files equal to or + * larger than a certain size. * * @param size the threshold size of the files * @throws IllegalArgumentException if the size is negative @@ -59,7 +60,8 @@ * threshold. * * @param size the threshold size of the files - * @param acceptLarger if true, larger files are accepted, else smaller ones + * @param acceptLarger if true, files equal to or larger are accepted, + * otherwise smaller ones (but not equal to) * @throws IllegalArgumentException if the size is negative */ public SizeFileFilter(long size, boolean acceptLarger) { @@ -73,7 +75,11 @@ //----------------------------------------------------------------------- /** * Checks to see if the size of the file is favorable. - * If size equals threshold, file is not selected. + * <p> + * If size equals threshold and smaller files are required, + * file <b>IS NOT</b> selected. + * If size equals threshold and larger files are required, + * file <b>IS</b> selected. * * @param file the File to check * @return true if the filename matches --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]