The AgeFileFilter in the ApacheSW Commons IOS library is a filter that can be used to filter files based on their last-modified dates. The AgeFileFilter class can take a 'cutoff' Date, long, of File (using the file's last-modified time as the reference) in its constructor. It can take a boolean as a second argument to the constructor. The boolean value specifies whether the returned files should come before or after the cutoff date/time.

The AgeFileFilterTest class first creates a directory (File) object to the "stuff" directory. It then creates a Date object for January 15th, 2008. Next, it lists all files in the "stuff" directory. It creates an AgeFileFilter object based on our Date object, and this is used to display the files in "stuff" that were last modified before January 15th, 2008. Following this, it creates an AgeFilter object based on our Date object but with "false" passed in as the second constructor argument. This is used to display the files in "stuff" that were last modified after January 15th, 2008.