org.apache.commons.finder.filters
Class SizeFilter

java.lang.Object
  extended by org.apache.commons.io.filefilter.AbstractFileFilter
      extended by org.apache.commons.finder.filters.SizeFilter
All Implemented Interfaces:
java.io.FileFilter, java.io.FilenameFilter, org.apache.commons.io.filefilter.IOFileFilter

public class SizeFilter
extends org.apache.commons.io.filefilter.AbstractFileFilter

IOFileFilter implementation that matches on the file size.

Since:
0.1
Version:
$Id: SizeFilter.java 437543 2006-08-28 05:47:51Z bayard $

Constructor Summary
SizeFilter(java.lang.String size)
          Construct a new IOFileFilter specifying the file size.
SizeFilter(java.lang.String size, boolean roundUp)
          Construct a new IOFileFilter specifying the file size.
 
Method Summary
 boolean accept(java.io.File file)
          Tests whether the File is a specified size.
 java.lang.String toString()
          Return a String representation of this class.
 
Methods inherited from class org.apache.commons.io.filefilter.AbstractFileFilter
accept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SizeFilter

public SizeFilter(java.lang.String size)
Construct a new IOFileFilter specifying the file size.

Parameters:
size - The minimum file size.

SizeFilter

public SizeFilter(java.lang.String size,
                  boolean roundUp)
Construct a new IOFileFilter specifying the file size.

Parameters:
size - The minimum file size.
roundUp - Whether equals compares should round up or down.
Method Detail

toString

public java.lang.String toString()
Return a String representation of this class.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the class.

accept

public boolean accept(java.io.File file)
Tests whether the File is a specified size.

Specified by:
accept in interface java.io.FileFilter
Specified by:
accept in interface org.apache.commons.io.filefilter.IOFileFilter
Overrides:
accept in class org.apache.commons.io.filefilter.AbstractFileFilter
Parameters:
file - The File to test.
Returns:
true if the File is a specified size, otherwise false.


Copyright © 2001-2008 The Apache Software Foundation. All Rights Reserved.