~ubuntu-branches/ubuntu/karmic/commons-io/karmic

« back to all changes in this revision

Viewing changes to src/java/org/apache/commons/io/filefilter/AgeFileFilter.java

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2008-02-21 13:26:43 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080221132643-p4c8f8lhb9rnqnlo
Tags: 1.4-1
* New upstream release
* Bump Standards-Version to 3.7.3
* Bump up debhelper compat to 6
* Replace XS-Vcs headers with Vcs
* debian/patches:
  - remove 01_no_ext_links.dpatch - not required
  - remove 02_no_mkdir_in_homedir.dpatch - not required
* Remove dpatch from Build-Depends
* Update debian/rules and debian/libcommons-io-java-doc.install
  with new target dirs
* debian/copyright: add copyright notice

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
package org.apache.commons.io.filefilter;
18
18
 
19
19
import java.io.File;
 
20
import java.io.Serializable;
20
21
import java.util.Date;
21
22
 
22
23
import org.apache.commons.io.FileUtils;
39
40
 * </pre>
40
41
 *
41
42
 * @author Rahul Akolkar
42
 
 * @version $Id: AgeFileFilter.java 463570 2006-10-13 06:14:41Z niallp $
 
43
 * @version $Id: AgeFileFilter.java 606381 2007-12-22 02:03:16Z ggregory $
43
44
 * @since Commons IO 1.2
44
45
 */
45
 
public class AgeFileFilter extends AbstractFileFilter {
 
46
public class AgeFileFilter extends AbstractFileFilter implements Serializable {
46
47
 
47
48
    /** The cutoff time threshold. */
48
 
    private long cutoff;
 
49
    private final long cutoff;
49
50
    /** Whether the files accepted will be older or newer. */
50
 
    private boolean acceptOlder;
 
51
    private final boolean acceptOlder;
51
52
 
52
53
    /**
53
54
     * Constructs a new age file filter for files equal to or older than
137
138
        return acceptOlder ? !newer : newer;
138
139
    }
139
140
 
 
141
    /**
 
142
     * Provide a String representaion of this file filter.
 
143
     *
 
144
     * @return a String representaion
 
145
     */
 
146
    public String toString() {
 
147
        String condition = acceptOlder ? "<=" : ">";
 
148
        return super.toString() + "(" + condition + cutoff + ")";
 
149
    }
140
150
}