commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r425240 - in /jakarta/commons/proper/io/trunk: RELEASE-NOTES.txt src/java/org/apache/commons/io/filefilter/FileFilterUtils.java src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
Date Tue, 25 Jul 2006 00:51:58 GMT
Author: niallp
Date: Mon Jul 24 17:51:57 2006
New Revision: 425240

URL: http://svn.apache.org/viewvc?rev=425240&view=rev
Log:
IO-87 - change parameter names and javadoc to make it more explicit that the maximum/minimum
values are inclusive. Also rename method to indicate its a "range" filter.

Modified:
    jakarta/commons/proper/io/trunk/RELEASE-NOTES.txt
    jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/FileFilterUtils.java
    jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java

Modified: jakarta/commons/proper/io/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/RELEASE-NOTES.txt?rev=425240&r1=425239&r2=425240&view=diff
==============================================================================
--- jakarta/commons/proper/io/trunk/RELEASE-NOTES.txt (original)
+++ jakarta/commons/proper/io/trunk/RELEASE-NOTES.txt Mon Jul 24 17:51:57 2006
@@ -87,7 +87,7 @@
   - The old INSTANCE constants are still present and have not been deprecated
 
 - FileFilterUtils
-  - new sizeFileFilter(long minimumSize, long maximumSize) method which 
+  - new sizeRangeFileFilter(long minimumSize, long maximumSize) method which 
     creates a filter that accepts files within the specified size range.
 
 - FileUtils

Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/FileFilterUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/FileFilterUtils.java?rev=425240&r1=425239&r2=425240&view=diff
==============================================================================
--- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/FileFilterUtils.java
(original)
+++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/FileFilterUtils.java
Mon Jul 24 17:51:57 2006
@@ -317,17 +317,17 @@
     }
 
     /**
-     * Returns a filter that returns true if the file size is within
-     * the specified range.
+     * Returns a filter that accepts files whose size is >= minimum size
+     * and <= maximum size.
      *
-     * @param minimumSize the minimum file size
-     * @param maximumSize the maximum file size
+     * @param minSizeInclusive the minimum file size (inclusive)
+     * @param maxSizeInclusive the maximum file size (inclusive)
      * @return an appropriately configured IOFileFilter
      * @since Commons IO 1.3
      */
-    public static IOFileFilter sizeFileFilter(long minimumSize, long maximumSize) {
-        IOFileFilter minimumFilter = new SizeFileFilter(minimumSize, true);
-        IOFileFilter maximumFilter = new SizeFileFilter(maximumSize + 1L, false);
+    public static IOFileFilter sizeRangeFileFilter(long minSizeInclusive, long maxSizeInclusive
) {
+        IOFileFilter minimumFilter = new SizeFileFilter(minSizeInclusive, true);
+        IOFileFilter maximumFilter = new SizeFileFilter(maxSizeInclusive + 1L, false);
         return new AndFileFilter(minimumFilter, maximumFilter);
     }
 

Modified: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java?rev=425240&r1=425239&r2=425240&view=diff
==============================================================================
--- jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
(original)
+++ jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
Mon Jul 24 17:51:57 2006
@@ -637,11 +637,11 @@
         assertFiltering(filter3, largeFile, false);
 
         // size range tests
-        IOFileFilter filter4 = FileFilterUtils.sizeFileFilter(33, 127);
-        IOFileFilter filter5 = FileFilterUtils.sizeFileFilter(32, 127);
-        IOFileFilter filter6 = FileFilterUtils.sizeFileFilter(33, 128);
-        IOFileFilter filter7 = FileFilterUtils.sizeFileFilter(31, 129);
-        IOFileFilter filter8 = FileFilterUtils.sizeFileFilter(128, 128);
+        IOFileFilter filter4 = FileFilterUtils.sizeRangeFileFilter(33, 127);
+        IOFileFilter filter5 = FileFilterUtils.sizeRangeFileFilter(32, 127);
+        IOFileFilter filter6 = FileFilterUtils.sizeRangeFileFilter(33, 128);
+        IOFileFilter filter7 = FileFilterUtils.sizeRangeFileFilter(31, 129);
+        IOFileFilter filter8 = FileFilterUtils.sizeRangeFileFilter(128, 128);
 
         assertFiltering(filter4, smallFile, false);
         assertFiltering(filter4, largeFile, false);



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message