public class LastModifiedFileListFilter extends java.lang.Object implements FileListFilter<java.io.File>
FileListFilter
implementation to filter those files which
File.lastModified()
is less than the age
in comparison
with the current time.
The resolution is done in seconds.
Constructor and Description |
---|
LastModifiedFileListFilter() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.io.File> |
filterFiles(java.io.File[] files)
Filters out files and returns the files that are left in a list, or an
empty list when a null is passed in.
|
long |
getAge() |
void |
setAge(long age)
Set the age that files have to be before being passed by this filter.
|
void |
setAge(long age,
java.util.concurrent.TimeUnit unit)
Set the age that files have to be before being passed by this filter.
|
public long getAge()
public void setAge(long age)
File.lastModified()
plus age is greater than the current time, the file
is filtered. The resolution is seconds.
Defaults to 60 seconds.age
- the agepublic void setAge(long age, java.util.concurrent.TimeUnit unit)
File.lastModified()
plus age is greater than the current time, the file
is filtered. The resolution is seconds.
Defaults to 60 seconds.age
- the ageunit
- the timeUnit.public java.util.List<java.io.File> filterFiles(java.io.File[] files)
FileListFilter
filterFiles
in interface FileListFilter<java.io.File>
files
- The files.